dir

Performs various directory functions.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X X X X

Syntax

expr dir(operation[,name])
int       operation
string    name

Description

You can perform one of five different operations with dir(). Select the operation by specifying the appropriate operation parameter (the mnemonics are found in trim.h):
dir_make (0) Make directory. Requires the name of the directory to make. Returns 0 on success.

dir_remove (1) Remove directory. Requires the name of the directory to remove. Returns 0 on success.

dir_change (2) Change directory. Requires the name of the directory to go to. Returns 0 on success.

dir_current (3) Get current directory. Returns working directory.

dir_separator (4) Get directory separator. Returns directory separator character.

Example

Change the current working directory.

 {
char wd[128];
wd = prompt("New directory: ");
if (!dir(2,wd)) printf("cwd set to "^^wd);
else printf("Invalid directory: "^^wd);
...
}