FTPCHMOD        Change permissions on a remote file

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands >

FTPCHMOD        Change permissions on a remote file

Syntax:

FTPCHMOD

[ file name ] [ permissions ]

Arguments:

[ file name ]

Variable or string defining the file name(s) on the FTP site. Wildcards are allowed.

 

[ permissions ]

Variable or string defining a POSIX-compatible permissions string to be applied to the remote file. Octal permissions such as "644", additive permissions such as "+rw", subtractive permissions such as "-x", and even grouped permissions like "u=rwx,g-w,o-x" are all supported.

Options:

/incldirs

Apply the given permissions recursively.

 

/target=xx

Apply permissions to (1) files only (/target=files); (2) directories only (/target=dirs); or (3) both files and directories (/target=both). "both" is the default.

 

 

This command is only valid when connecting to an SFTP site.

 

This script command is used to apply a set of standard POSIX-compatible permissions to remote file(s) on an SFTP site.

 

Examples:

 

FTPCHMOD "myfiles.txt" "644"

 

FTPCHMOD "dir/*" "u+x" /incldirs

 

FTPCHMOD "dir/*" "u=rwx,g-w,o-x"

 

FTPCHMOD "dir/*" "644" /target=files /incldirs

 

FTPCHMOD "dir/*" "755" /target=dirs /incldirs

 

Note: the POSIX "X" (special execute) chmod permission value is not supported by this command but similar functionality can be achieved by using /target= to apply the permissions to only files or only directories. This should not be confused with the lowercase "x" (execute) which is fully supported by this command.