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

[ permissions ] [ file name ]

Arguments:

[ 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.

 

[ file name ]

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

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 "644" "myfiles.txt"

 

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

 

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

 

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

 

FTPCHMOD "755" "dir/*" /target=dir /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.