Using the %currentlocaldir Variable

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Internal Script Variables >

Using the %currentlocaldir Variable

 

The current local working folder is maintained in an internal variable named %currentlocaldir.

 

WORKINGDIR "c:\temp"

DISPLAY %currentlocaldir

 

Whenever changing the working folder in script functions or called scripts, it is recommended that the original working folder always be restored prior to returning. Below is a sample function that stores the current working folder into a user defined variable, changes the working folder to perform some logic (not shown) and then restores the original working folder before returning.

 

FUNCTION things todo

;; save current working folder

SET savdir = %currentlocaldir

;; do work in other folder

WORKINGDIR "c:\temp"

;; [...]

;; restore original working folder

WORKINGDIR savdir

RETURN

ENDFUNCTION

 

 

Related command(s): WORKINGDIR

See also: Internal Script Variables, %currentsitedir, FTPCD, FTPPWD