Clib Get Current Working Directory Method

The Clib Get Current Working Directory method returns the entire path of the current working directory. The default current working directory is the directory where you install the Siebel application.

If a script uses the Clib Change Directory method or a similar method to change the current working directory, then the current working directory returns to the original value after the script finishes.

Format

Clib.getcwd()

The following example displays the current directory in a message box. The script then makes the root directory 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;
// Must be 0, indicating no error.
   TheApplication().Trace(msg);

// Change the current directory to the new 'Clib test'
   Clib.chdir("C:\\Clib test");
   TheApplication().Trace("Current directory is " + Clib.getcwd());
// Delete 'Clib test'
   Clib.chdir("C:\\");
   Clib.rmdir("Clib test");
// Attempting to make a removed directory current yields error flag
   msg = Clib.chdir("C:\\Clib test");
   TheApplication().Trace(msg);
}

This example displays the following output:

Current directory is C:\SIEBEL\BIN
0
Current directory is C:\Clib test
-1