How to use transcript to set file permissions over FTP.

Dave Cragg dcragg at lacscentre.co.uk
Wed Apr 21 14:22:37 EDT 2004


At 2:58 pm -0300 21/4/04, Andre Garzia wrote:
>Hi folks,
>
>I am finishing a nice stack to setup LibCGI on a remote server, but
>I forgot about file permissions, is there a way for setting it from
>transcript? It's over FTP, I am using LibURLUploadFile to put the
>file there, is there a way to say "Hey Engine, set that file to 755
>permission"? As soon as someone answer, I'll put the stack here.

Look at libUrlFtpCommand.

The following script (from 
<http://www.runrev.com/resources/liburl/releases.shtml>) does  what 
you want.

         put "192.168.123.4" into tHost
         put "testfolder/file_1.cgi" into tFile
         put "dave" into tUser
         put "*****" into tPass##use a real password
         put "SITE CHMOD 755" && tFile into tCmd
         get libUrlFtpCommand(tCmd, tHost,tUser,tPass)
         answer it

Not all servers support the SITE CHMOD command.  In that case, the 
libUrlFunction will return something like "550 Command not supported".

Cheers
Dave


More information about the use-livecode mailing list