Search    
 

   
 

 
PRAGMA PROGRAM REFERENCE MANUAL
Index
All Operation

Expand All      ADDENDUM
DOS COPY DC Standard Verb Operating System Operation
Target = IPC STATUS (IS)

Copies an operating system file to another operating system file.

The noun IPC STATUS contains the result of the DOS COPY operation.



DOS COPY object is FILENAME

FILENAME is an expression or a noun containing the SOURCEFILE and the DESTIN-
ATIONFILE. SOURCEFILE and DESTINATIONFILE must be separated by a space.


SEE ALSO: DOS EXIST / IPC STATUS

DOS COPY (DC)


DOS COPY copies an operating system file to another operating system file. The result of the operation will be written to the standard noun IPC STATUS (IS). If the file you want to copy exists, the noun IPC STATUS will contain OK and the file will be copied to the specified destination file. If the file you want to copy does not exist, the IPC STATUS will contain FILE NOT FOUND.

If the destination file does not exist, it will be created.


DOS COPY lets you copy a file in any directory or drive to a file in any other directory or drive by simply preceding the filenames with the drive and path. If the destination directory does not exist, the IPC STATUS will contain FILE NOT FOUND.


DOS COPY also lets you copy a file to the console or to the printer, in which case the contents of the file (which must be a textfile) will either be displayed on the screen or printed by the printer. To copy to the console write CON in place of the name of the destination file. To copy to the printer write PRN in place of the destination file.



EXAMPLES


VERB called TEST DOS COPY

1 DOS COPY object is "TEST.PFM \BACKUPS\TEST.PFM"
2 DISPLAY the value IPC STATUS


This example copies the file TEST.PFM that resides in the current directory to a file with the same name but in the directory \BACKUPS.

The name of the sourcefile and the name of the destination file must always be separated by a space.



VERB called TEST DOS COPY TO CONSOLE

1 DOS COPY object is "C:\AUTOEXEC.BAT CON"
2 IF the value IPC STATUS "<>" the value "OK
do
DISPLAY the value IPC STATUS
else
end
3 INPUT KEY into the noun KEY


This example copies to the console (i.e., displays) the file AUTOEXEC.BAT which resides in the root directory of your C drive. In the unlikely event that you don't have an AUTOEXEC.BAT file the verb will display the IPC STATUS as FILE NOT FOUND.

To copy the file AUTOEXEC.BAT to your printer (i.e., print) you would substitute the expression "C:\AUTOEXEC.BAT CON" with the expression "C:\AUTOEXEC.BAT PRN"

The last line with the verb INPUT KEY is only there to stop the program after the display.


It is important that you always check the IPC STATUS since you are performing an operation on the operating system level where things are beyond the control of PRAGMA.


Please take note that the examples shown above are for the DOS operating system.


 

CustomWare® is a registered trademark of CustomWare Designs, Inc. All rights reserved.
CustomWare® is a registered servicemark of CustomWare Designs, Inc.  All rights reserved.
All images and designs on this web site are copyrighted© 2021.
v t