Hi Listers,
I'm currently working on a project using Metacard's ability to move files between my local computer and an FTP site. I'm using the following syntax:
Put url "ftp://userName:[EMAIL PROTECTED]/myFolder/myFile/" into myLocalFilePath
Can anybody help me with the syntax to also do the following:
1) delete an FTP file
As Klaus said, delete url ftp://whatever
2) change the directory of an FTP file (without having to rewrite it)
I take it you mean change the directory name and not move files to a different directory.
This is a bit messy, but can be done with libUrlFtpCommand.
First use the CWD command to change to the directory that contains the one you want to change. Then use RNFR and RNFT to change the name.
put "ftp.myserver.com" into tHost
put "dave" into tName
put "secret" into tPass
put "olddirname" into tFrom
put "newdirname" into tTo
put "CWD /path/to/parent/folder" into tCmd
get libUrlFtpCommand(tCmd,tHost,tName,tPass)
if word 1 of it is 250 then ##check for success
put put "RNFR" && tFrom into tCmd
get libUrlFtpCommand(tCmd,tHost,tName,tPass)
if word 1 of it is 350 then##really 350 this time
put put "RNTO" && tTo into tCmd
get libUrlFtpCommand(tCmd,tHost,tName,tPass)
if word 1 of it is not 250 then
## error stuff
end if
end if
end ifBy the way, if you have Fetch on a Mac, a good way to discover the FTP command syntax is to open the transcript window, perform the actions you want to emulate, and note the commands that were issued. (I guess other FTP clients probably have the same feature.)
Cheers Dave _______________________________________________ metacard mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/metacard
