Re: FTP multiple spaces in file names being lost

Giganews Newsgroups
Subject: Re: FTP multiple spaces in file names being lost
Posted by:  Remy Lebeau (Indy Team) (no.spam@no.spam.com)
Date: Wed, 28 Feb 2007

"Andrew" <someone@nospam.com> wrote in message
news:EB69D58BB51CE340someone@nospam.com...

> I am using Delphi 7 with Indy 9.  I am finding that multiple spaces
> in file names are being replaced by single spaces.
>
> If you try TidFTP.MakeDir('abc  123') you get abc 123 with one
> space in between instead of two.

Indy passes the specified name as-is to the server, so it is the
server itself that is changing it.  The FTP specs allow the server to
modify the name to suit the particular file system being used.  Also,
on some file systems, the path specified to ChangeDir() and MakeDir()
are not compatible with each other (this is documented in the FTP
spec).  So there is no guarantee that the name you specify is the name
that the server will actually use.  That is why the server's reply to
MakeDir() will include the actual name that was used, and that is the
name that you must specify when referring to the folder later on, such
as in ChangeDir().

Gambit

Replies

None

In response to

FTP multiple spaces in file names being lost posted by Andrew on Wed, 28 Feb 2007