Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > S

SHARECPY

Scroll Prev Top Next More

Use the SHARECPY command to copy files, including files being shared on a network.

 

SHARECPY

 

Options

 

filesource

Specifies the file to be copied, the source file

 

filetarget

Specifies the file to receive the copy, the target file

 

About the SHARECPY Command

 

The command is particularly useful for making a backup copy of a database that is shared on a network.

 

Although you should not attempt to copy the database while users are actively making changes to it, the command allows you to copy it without having to make sure that all users have disconnected from the database.

 

When SHARECPY is in the process of copying files, and encounters locked bytes in a file (which means it cannot read those bytes), the resulting file will have those bytes replaced with zeros. Such a resulting file will most likely be corrupted, but the command will read what it can.

 

When you copy files from one drive to another, include the drive letter of the drive you want to copy to.

 

When you copy files from one directory to another directory, the name of the directory you want to copy to must be different from the current directory.

 

Naming Copied Files

 

When you copy a file from one drive or directory to another drive or directory, you can keep the same name for the new file, or you can give the file a new name. If you want to make a copy of a file on the same directory, you must give the file a different name. If the new name is the name of an existing file, SHARECPY replaces the existing file with the file you are copying.

 

Using Wildcards with the SHARECPY Command

 

When copying a group of files, you can use the operating-system wildcards (? or *) in the file specification. The settings for the R:BASE special characters SINGLE and MANY do not affect the operating system wildcards.

 

When the target name is the same length as the source name, the command succeeds. However, if the target name is shorter or longer than the source name, the results are unpredictable.

 

Backing Up with the SHARECPY Command

 

You can use the SHARECPY command to backup your database, command files, and programs. When copying a database, copy all four database files as a set.

 

If you change the file extension when you use SHARECPY to backup your database files, you must change the extension back to the original extension to use the database in R:BASE. The SHARECPY command does not copy files onto multiple disks. If your database is too large to fit on one disk, use the BACKUP or UNLOAD commands.

 

Suggestion

 

On a workstation with multiple drives (local or mapped), especially when the files are on the different drive, it is always the best practice to define a drive letter when copying, deleting, renaming or running files, unless the specified files are located in the working directory. You will not need to specify the drive letter if all of the files are located in the default directory when using the copy, delete, rename or run commands.

 

Examples

 

The following copies the copies a database called mydb from the current directory to another directory called BACKUP:
 

SHARECPY mydb.rb? C:\backup\*.*

 

The following command copies any files in the DBS directory that begin with MYDATA and have the extension .RX? to the ADMIN directory on the current drive using the same file names. The files with the .RX? extension could be the four disk files that contain an R:BASE database: MyData.RX1, MyData.RX2, MyData.RX3, and MyData.RX4.

 

SHARECPY /DBS/MyData.rx? /admin

 

The following command copies the MYDATA database files with an .RX? extension and changes the extension to .SV?

 

SHARECPY MyData.rx? MyData.sv?