Board index » delphi » TidFTP and ChangeDir problems!

TidFTP and ChangeDir problems!

[This followup was posted to borland.public.delphi.internet.winsock and
a copy was sent to the cited author.]

In article <3e25515...@newsgroups.borland.com>, Kab...@sjalala.com
says...

Quote
> Hi all.. I am trying to build an ftp client and am running into a little
> problem.
> When I've done a LIST on the server and the DirectoryListing is succefully
> filled,
> I regulary have Directories with filenames that start or end with space (I
> checked and they ARE #32) Now If I want to change to that directory I get an
> exception stating that the given directory does not exist, however using an
> different FTP-Client I can certify that the directories DO exist, and can
> enter browse etc.

> The question How can I do this with INDY??
> (btw am using latest version)

Try inclusing the filename in quotes such as:

ChangeDir('"My Long Dir With Spaces  ");

HTH.
--
J. Peter Mugaas - Chairperson, Distribution Team, Indy Pit Crew
Internet Direct (Indy) Website - http://www.nevrona.com/Indy
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you.  Otherwise, do
not contact me.

 

Re:TidFTP and ChangeDir problems!


Hi all.. I am trying to build an ftp client and am running into a little
problem.
When I've done a LIST on the server and the DirectoryListing is succefully
filled,
I regulary have Directories with filenames that start or end with space (I
checked and they ARE #32) Now If I want to change to that directory I get an
exception stating that the given directory does not exist, however using an
different FTP-Client I can certify that the directories DO exist, and can
enter browse etc.

The question How can I do this with INDY??
(btw am using latest version)

Re:TidFTP and ChangeDir problems!


Quote
> In article <3e25515...@newsgroups.borland.com>, Kab...@sjalala.com
> says...
> > Hi all.. I am trying to build an ftp client and am running into a little
> > problem.
> > When I've done a LIST on the server and the DirectoryListing is
succefully
> > filled,
> > I regulary have Directories with filenames that start or end with space
(I
> > checked and they ARE #32) Now If I want to change to that directory I
get an
> > exception stating that the given directory does not exist, however using
an
> > different FTP-Client I can certify that the directories DO exist, and
can
> > enter browse etc.
> Try inclusing the filename in quotes such as:
> ChangeDir('"My Long Dir With Spaces  ");

Well that didn't help ;-)

But on irc I got a helpfull hint... If I replaced then first #32 with a
0X020 then it works (most of the time)
But why then do I get #32 in then LIST when it should be 0x020 ???
It can't be that for every path with spaces in it I should test for every
possible combination of #32 and 0X020 in order to get in? Should it?

Re:TidFTP and ChangeDir problems!


In article <3e25763...@newsgroups.borland.com>, Kab...@sjalala.com
says...

Quote
> > In article <3e25515...@newsgroups.borland.com>, Kab...@sjalala.com
> > says...
> > > Hi all.. I am trying to build an ftp client and am running into a little
> > > problem.
> > > When I've done a LIST on the server and the DirectoryListing is
> succefully
> > > filled,
> > > I regulary have Directories with filenames that start or end with space
> (I
> > > checked and they ARE #32) Now If I want to change to that directory I
> get an
> > > exception stating that the given directory does not exist, however using
> an
> > > different FTP-Client I can certify that the directories DO exist, and
> can
> > > enter browse etc.

> > Try inclusing the filename in quotes such as:
> > ChangeDir('"My Long Dir With Spaces  ");

> Well that didn't help ;-)

> But on irc I got a helpfull hint... If I replaced then first #32 with a
> 0X020 then it works (most of the time)
> But why then do I get #32 in then LIST when it should be 0x020 ???

Hm, from what I understand, a 0x020 is a C++ syntax for a hexidecimal
value of 20 (which in decimal is 32).  That's about the only thing I
could think.

Quote
> It can't be that for every path with spaces in it I should test for every
> possible combination of #32 and 0X020 in order to get in? Should it?

I don't know and this is a new thing for me.  I had tested that
suggestion with Microsoft's FTP console client and a Netware server.  I
don't know how helpful this would be but one possibility to try might be
%20.  That's a URL-encoded space.  Some servers might use that just to
keep some web-browsers happy.  I don't know though.
--
J. Peter Mugaas - Chairperson, Distribution Team, Indy Pit Crew
Internet Direct (Indy) Website - http://www.nevrona.com/Indy
Personal Home Page - http://www.wvnet.edu/~oma00215
If I want to do business with you, I will contact you.  Otherwise, do
not contact me.

Other Threads