Search    
 

   
 

 
PRAGMA PROGRAM REFERENCE MANUAL
Index
All Operation

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

Renames an existing OS file or moves a file from one subdirectory to another.

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



DOS RENAME object is FILENAME ("PATH\OLDNAME PATH\NEWNAME")

FILENAME is an expression or a noun containing the OLDNAME and the NEWNAME.
OLDNAME and NEWNAME can have a path. If the subdirectory is not the same, the
file will be moved from one subdirectory to the other.

SEE ALSO: DOS COPY

DOS RENAME (DRN)


DOS RENAME renames an operating system file or moves a file from one directory to another.

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 renamed or moved. If the file you want to rename does not exist, the IPC STATUS will contain FILE NOT FOUND.



EXAMPLES


VERB called TEST DOS RENAME

1 DOS COPY object is "TEST.TXT NEWTEST.TXT"
2 DISPLAY the value IPC STATUS


This example renames the file TEST.TXT that resides in the current directory to NEWTEST.TXT. If the file TEST.TXT does not exist the verb will display the IPC STATUS as FILE NOT FOUND.

The original name of the file and the new name of the file must always be separated by a space.



VERB called TEST DOS MOVE

1 DOS RENAME object is "TEST.TXT C:\TEST.TXT"
2 DISPLAY the value IPC STATUS


This example moves the file TEST.TXT from the current directory to the root directory of your C drive.


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