Siebel eScript Language Reference > Siebel eScript Commands > File I/O Methods in eScript >

Clib.getcwd() Method

This method returns the entire path of the current working directory for a script.




Not applicable



The entire path of the current working directory for a script.


In a Siebel application, the default current working directory is the directory in which the application has been installed. If a script changes the current working directory (using Clib.chdir() or similar command), the current working directory returns to its original value when the script finishes.


In this example, the current directory is displayed in a message box. The script then makes the root the current directory, creates a new directory, removes that directory, and then attempts to make the removed directory current.

function Button_Click ()


   var currDir = Clib.getcwd();
   TheApplication().Trace("Current directory is " + Clib.getcwd());
   var msg = Clib.mkdir('C:\\Clib test');
   // Display the error flag created by creating directory;   
   // Should be 0, indicating no error.
   // Change the current directory to the new 'Clib test'
   Clib.chdir("C:\\Clib test");
   TheApplication().Trace("Current directory is " + Clib.getcwd());
   // Delete 'Clib test'
   // Attempting to make a removed directory current yields error
   Clib.rmdir("Clib test");
   msg = Clib.chdir("C:\\Clib.test");

The output displayed in the message boxes is as follows:

Current directory is C:\SIEBEL\BIN
Current directory is C:\Clib test

See Also

Clib.clearerr() Method
Clib.mkdir() Method
Clib.rmdir() Method

Siebel eScript Language Reference