Application Developer Guide > Accessing the Operating System > Changing the Current Working Directory
  

Changing the Current Working Directory
Like every process, PV-WAVE has a current working directory. This is the default directory used when you do not explicitly specify the directory. The initial working directory is the directory you were in when you issued the command to start PV-WAVE.
Using the CD Procedure
You can use the CD command to change this working directory at any point during the PV-WAVE session. This new working directory affects the current session, and any child processes that you start from PV-WAVE, but it does not change the current directory of the process that started PV‑WAVE. Therefore, when you exit PV-WAVE, you will find yourself back in the directory you were in when you started.
On a UNIX system, to change the current directory to /usr/stardata, enter:
WAVE> CD, '/usr/stardata'
On a Windows system, to change the current directory to \home\stardata, enter:
WAVE> CD, '\home\stardata'
In order to change to your login directory, you can provide a null argument. In addition, the Current keyword can be used to save the current directory before any change is made. The following command saves the current directory and then changes it to your home directory:
WAVE> CD, '', Current=OLDDIR
Later, you can restore the current directory to its previous value with the command:
WAVE> CD, OLDDIR
Using the PUSHD, POPD, and PRINTD Procedures
The PUSHD, POPD, and PRINTD procedures are provided to make interactive use of CD more convenient by maintaining a stack of directories. PUSHD saves the current directory on the top of the stack and then changes it to the directory given by its argument. POPD sets the current directory to the directory at the top of the stack and removes that directory from the stack. PRINTD shows you the current entries on the stack.
UNIX Example
Using these user procedures, the previous CD example could be written:
; Change to your home directory.
WAVE> PUSHD, ''
; Execute some statements.
. . .
; Return to the original working directory.
WAVE> POPD
Windows Example
Using these user procedures, the previous CD example could be written:
; Change the directory.
WAVE> PUSHD, 'c:\temp'
; Execute some statements.
. . .
; Return to the original working directory.
WAVE> POPD
 

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.