The professional tool to automate FTP and secure FTP transfers. Automated FTP & Batch FTP |
Change remote file permissions.
Syntax: CHMOD(mode,filename,SUBDIRS)
Remarks:
Command History:
ScriptFTP 2.0.1 Build 14 Feb 2006: Added support for applying CHMOD to directories.
ScriptFTP 2.0.1 Build 21 Feb 2006: Added the optional parameter SUBDIR for applying CHMOD to files in subdirectories.
Return Value:
CHMOD will return "OK" if the file permissions have been applied correctly. If it encounters an error it will return an error code.
Example:
# Connect to server
OPENHOST("ftp.scriptftp.com","john","123456")
# Upload some files
PUTFILE("*.php",SUBDIRS)
# Apply 667 to index.php in the current remote directory
CHMOD(667,"index.php")
# Apply 777 to all php files in the current remote directory
CHMOD(777,"*.php")
# Apply 777 to all php files in the /cgi-bin/ directory
CHMOD(777,"/cgi-bin/*.php")
# Apply 777 to all php files in the /cgi-bin/
# directory and subdirectories
CHMOD(777,"/cgi-bin/*.php",SUBDIRS)
# Apply CHMOD to mysubdir
CHMOD(488,"/mydir/mysubdir/")
# Close connection
CLOSEHOST