Try OpenEdge Now
skip to main content
Coding for Portability
Operating system statements : Standard system commands
 

Standard system commands

Where possible, use standard system commands instead of variants unique to certain hardware manufacturers. The following table lists the OS statements that promote portability by avoiding limitations of operating-system-specific commands. These statements allow you to create a single version of a procedure that works differently on varying operating systems.
Table 1. OS statements
OS statement
Description
OS-APPEND
Performs a system call to execute the operating system command that appends two files.
OS-COMMAND
Performs a system call to execute an operating system command that you specify.
OS-COPY
Performs a system call to execute the operating system command that copies a file.
OS-CREATE-DIR
Performs a system call to execute the operating system command that creates a new directory.
OS-DELETE
Performs a system call to execute the operating system command that deletes a file or directory. You can delete one or more files, a directory, or an entire directory branch.
OS-DRIVES
Performs a system call to execute the operating system command that returns a comma-separated list of the available drives in Windows.
OS-ERROR
Returns an OpenEdge error code that indicates whether an execution error occurred during the last OS-APPEND, OS-COMMAND, OS-COPY, OS-CREATE-DIR, OS-DELETE, or OS-RENAME statement.
OS-GETENV
Performs a system call to execute the operating system command that returns a string containing the value of the specified environment variable in the environment in which OpenEdge is running.
OS-RENAME
Performs a system call to execute the operating system command that renames a file or directory.
See OpenEdge Development: ABL Reference for more information on these statements.