Re: Ftp.SetModTime ????

Giganews Newsgroups
Subject: Re: Ftp.SetModTime ????
Posted by:  J. Peter Mugaas (oma002…@mail.wvnet.edu)
Date: Mon, 25 Jul 2005

On Mon, 25 Jul 2005 05:31:32 -0400, Eray HANOGLU wrote:
> when using SetModTime function it raises an exception "no such file
> or directory". but the file exists. any body have an idea?

Yes, unfortunateloy.  SetModTime uses a command called MDTM.  That command on most servers means to request a file's last modified date.  This is what the specification says.  Unfortunately, some servers and some clients also use (I should say abuse), that command to set the last modified file date.  Indy's FTP client and server do support this abuse of the MDTM for compatibility reasons.  If the server does support a "MFMT" command, Indy will use that instead of MDTM but most servers do not support that command.

The syntax for getting a file date is:

MDTM MyFileName

and to set the file date, the syntax usually is something like "MDTM filedate MyFileName".  If a server doesn't support setting the file date with MDTM, the server may interpret the filedate as bthe start of the filename.  Since a file with such a name doesn't exist, you get that error about a file not existing.

So all I can say is that server does NOT support setting the file date with the MDTM command.  I know that the error sounds confusing but it's the consequences of someone else's bonked design.

HTH.

Replies

None

In response to

Ftp.SetModTime ???? posted by Eray HANOGLU on Mon, 25 Jul 2005