CWD

Top  Previous  Next

 

The CWD command changes the current working directory.

 

 

Format

 

CWD {pathname}

 

where

 

pathnameis the pathname of the desired new working directory. If omitted, the CWD command returns to the directory of the current QM account.

 

 

The CWD command allows an application to temporarily switch to an alternative working directory. It may be of use when using the SH command or the QMBasic OS.EXECUTE statement to perform operating system commands for which the working directory is must be set correctly.

 

It is important to revert back to the account directory as soon as possible because there is an assumption in many commands and user applications that the working directory is that of the current account.

 

 

Example

 

PA

CWD /home/appdev

SH gcc *.c

CWD

 

The above example paragraph uses CWD to switch to the /home/appdev directory and runs the gcc compiler. It then returns to the account directory.