Relative v.s. absolute paths

Top  Previous  Next

Several commands in the FTCL language make reference to relative and absolute paths. Understanding how relative and absolute paths are used in the local and remote environments is important to using the FTCL commands properly. The commands that make use of relative and/or absolute paths include:

 

append

cd

del

deldir

get

getdir

lcd

lcopy

ldel

ldeldir

lmove

lrename

put

putdir

rename

set logfile

set privatekey

 

 

Local Environment

 

In the local environment, absolute paths are defined by providing the full system path to the desired file or directory. Relative paths are defined by providing the path relative to the current local directory. The current local directory may be set using the lcd command. This directory is used to calculate the absolute path.

 

Example Relative Paths

 

Current Local Directory

Path

Resulting Path

c:/tmp

logs

c:/tmp/logs

c:/tmp

logs.txt

c:/tmp/logs.txt

c:/tmp

logs/logs.txt

c:/tmp/logs/logs.txt

 

Example Absolute Paths

 

When using absolute paths the Current Local Directory is ignored. Instead the absolute path is determined by the path provided.

 

Current Local Directory

Path

Resulting Path

c:/tmp

c:/www/images

c:/www/images

c:/tmp

c:/logs/archive

c:/logs/archive

 

Remote Environment

 

In the remote environment, absolute paths are defined by providing the full path to the desired file or directory as understood by the FTP/SFTP server. Relative paths are defined by providing the path relative to the current remote directory. The current remote directory may be set using the cd command. This directory is used to calculate the absolute path.

 

Example Relative Paths

 

Current Remote Directory

Path

Resulting Path

/var

logs

/var/logs

/var

logs.txt

/var/logs.txt

/var

logs/logs.txt

/var/logs/logs.txt

 

Example Absolute Paths

 

When using absolute paths the Current Local Directory is ignored. Instead the absolute path is determined by the path provided.

 

Current Remote Directory

Path

Resulting Path

/var

/home/users

/home/users

/var/

/home/users/jsmith

/home/users/jsmith





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC