Progress
Language Reference


OS-CREATE-DIR Statement

Interfaces
OS
SpeedScript
All
All
Yes

Executes an operating system command from within Progress that creates a new directory.

SYNTAX

OS-CREATE-DIR { dirname | VALUE ( expression ) } ... 

dirname

The name of the 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 the dirname is not fully qualified, Progress will prepend the current working directory to the dirname.

VALUE ( expression )

An expression that returns the name of the 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.

r-os-dir.p
DEFINE VARIABLE stat AS INTEGER.
DEFINE VARIABLE dir_name AS CHARACTER 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

SEE ALSO

OS-ERROR Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095