WORKINGDIR Change local default (working) folder |
Top Previous Next |
This script command defines the default folder for all file oriented script commands. Anytime a file name is specified in a command without a full path associated with it, Robo-FTP either searches for or creates this file in the designated working folder. The selection made in this command overrides the default selection set with the Robo-FTP Configurator.
The current working folder is always maintained in the %currentlocaldir variable.
Consider the following example.
;; read record in "c:\Program Files\Robo-FTP\example.txt" WORKINGDIR "c:\Program Files\Robo-FTP" READFILE "example.txt" first_record
If a partial path is specified, it and the previous working folder are used to define the new working folder.
;; current working folder is "c:\Program Files\Robo-FTP" WORKINGDIR "test" ;; new working folder is now "c:\Program Files\Robo-FTP\test"
If “..” is specified, the new working folder is set one folder above the previous working folder.
;; current working folder is "c:\Program Files\Robo-FTP" WORKINGDIR ".." ;; new working folder is now "c:\Program Files"
Caution The directory change made by WORKINGDIR is global within the Robo-FTP script environment. If WORKINGDIR is going to be called in a function or a called script, it is always recommended that the current working folder be saved on entry and restored on exit if it is going to be changed. See the help topic for the %currentlocaldir internal variable for an example.
The directory change made by WORKINGDIR will be overwritten if you use FTPLOGON to connect to a Managed Site that specifies a different Initial Working Directory.
Use the FTPCD script command to change to a different directory on a remote site.
Related Command(s): ARCHIVEDIR, MAKEDIR, LISTDIR
|