REN / SITE chmod commands possible? (General questions)
Hello all,
with the FTP components I formerly used - which had no
SSL/SSH capability, I was as well able to use a command
similar to FtpDlx' command RawSend .
I was wondering if the following commands would work:
* Renaming remote file (Delphi-syntax):
RawSend ('ren + filefrom + ' ' + fileto + ' ' + CRLF);
* File permissions:
RawSend ('SITE chmod ' + NewPerm + ' ' + Filename + CRLF);
I would like to know if these are possible at all or
only within specific protocols?
If not, are there equivalent commands/workarounds in other
protocols otherwise?
Thanks a lot in advance,
Tobias
Re:
Hi,
RawSend method can be used only with FTP style protocol - FTP and FTPS. It can be used to 'inject' specific command or data anytime during session lifetime, to override or adjust behavior of wodFtpDLX. For example, you can get current path on the server just by issuing PWD command.
Make sure you always use vbCrLf (13+10) sequence after you send data - so that server knows it's actually a command you want to execute. If you don't send it, server will not act on your command, and will wait more data to arrive.
No matter what's current setting for Blocking property, this method will NEVER block. This makes sense - because it cannot know what you're sending and what to expect as an answer. No matter what reply is received by the server, wodFtpDLX will silently ignore it. If you want to check server's reply, you should check what it returns using FTPReply event.
Regards,
Alan
Re:
Hi Alan,
since your reply is the help topic's contents, I assume
that I don't have to worry about anything else regarding
my question, which is good, thanks.
Cheers,
Tobias
Re:
Tobias,
yes, you're safe to use RawSend the way you explained.
Regards,
Kreso