Previous Next

OS-CREATE-DIR statement
Executes an operating system command from within ABL that creates one or more new directories.
Syntax 
 
OS-CREATE-DIR { dirname | VALUE ( expression ) } ...
dirname
The name of a directory to create. If the directory already exists, no error is generated. If a file with this name exists, an error is generated. The name can be a pathname or a simple name.
If dirname is not a fully qualified directory name, ABL prepends the current working directory to dirname.
VALUE ( expression )
An expression that returns the name of a directory to create. Expression can contain constants, field names, and variable names.
Example 
The following procedure prompts the user for the name of a directory, then creates it. If the name you give is not fully qualified, the directory is created in your current directory.
 
DEFINE VARIABLE stat     AS INTEGER   NO-UNDO.
DEFINE VARIABLE dir_name AS CHARACTER NO-UNDO FORMAT "x(64)"
  LABEL "Enter the name of the directory you want to create.".
 
UPDATE dir_name.
OS-CREATE-DIR VALUE(dir_name).
stat = OS-ERROR.
IF stat NE 0 THEN
  MESSAGE "Directory not created. System Error #" stat.
Notes 
*
*
*
Although an error can occur during execution of this statement, the statement does not generate an error message, raise an error condition, or affect the program’s flow in any way. Check for an execution error by using the OS-ERROR function and evaluating the return.
See also 
OS-ERROR function

Previous Next
© 2012 Progress Software Corporation and/or its subsidiaries or affiliates.