Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object >

Clib.getcwd() Method


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

Syntax

Clib.getcwd()

Parameter
Description
Not applicable
 

Returns

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

Usage

In a Siebel application, the default (current working) directory in a Windows environment is always C:\Siebel\bin. When a script finishes running, the default directory returns to C:\Siebel\bin, even if the script changes the current working directory.

Example

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.
   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:\\");
   // Attempting to make a removed directory current yields error
       flag
   Clib.rmdir("Clib test");
   msg = Clib.chdir("C:\\Clib.test");
   TheApplication().Trace(msg);
}

The output displayed in the message boxes is as follows:

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

See Also

Clib.chdir() Method, Clib.mkdir() Method, and Clib.rmdir() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003