Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / Delphi - Using IdFTP by Indy To Return FTP Directories Help?

Author
Message
The Lone Programmer
22
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 2nd Apr 2006 20:22
Hello,
I have been trying to learn how to use the IdFTP component by Indy, and I have found myself stuck at a certain point.

I am having difficulties returning all the directories in a current directory. I am able to return all the files, or every single item in the FTP space, but not just directories.

I have done some google searching and tried their methods, but I just get errors and stuff. I was wondering if anyone here knew how to return just directories using the IdFTP component.

Thanks,
The Lone Programmer

"Is The Juice Worth The Squeeze"
-The Girl Next Door
Sergey K
21
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 2nd Apr 2006 23:48
hey dude
it should be something like:


(try it with Memo1 component)

MyNewSite:http://gogetax.com
Forums(About BLO and more):http://gogetax.com/forum
The Lone Programmer
22
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 3rd Apr 2006 04:55
That displays all files and folders.

What about just directories.

IdFTP.List(TStrings, '*.*', False) - Does only files
IdFTP.List(TStrings, '', False) - Does files and folders
IdFTP.List(TStrings, '*', False) - Does all files, folders, and subjunk

What about JUST folders?

Thanks,
The Lone Programmer

"Is The Juice Worth The Squeeze"
-The Girl Next Door
Sergey K
21
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 4th Apr 2006 13:11
errr.. that you can do by your self by reading the command line of each file in the list..

MyNewSite:http://gogetax.com
Forums(About BLO and more):http://gogetax.com/forum
The Lone Programmer
22
Years of Service
User Offline
Joined: 29th Jan 2003
Location: California, USA
Posted: 4th Apr 2006 18:02
Are folders able to contain the period(.) character? Cause I just realized that I could do:
If String<>Contain Period(.) Then Label As Directory Else Label As File

I don't know what characters folders are allowed to have.

Thanks,
The Lone Programmer

"Is The Juice Worth The Squeeze"
-The Girl Next Door
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 4th Apr 2006 23:50
Folders cannot have any of these characters in the file name


And the meek shall inherit the Earth...
Sergey K
21
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 5th Apr 2006 12:33 Edited at: 5th Apr 2006 12:34
the .blablabla files means system files or something..

take a look at the list that the .list() command gives you~
in that list it exactly says if its folder,file or system file.
it also says the access parameters to that folder/file on same line.

it goes something like:
-rw------- 1 peter 848 Dec 14 11:22 00README.txt

the "-rw-------" is the access limit for the file/folder..

MyNewSite:http://gogetax.com
Forums(About BLO and more):http://gogetax.com/forum
Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 5th Apr 2006 23:57
You know, in DOS if you do

DIR *.

It just brings a list of directories. Have you tried *. as a parameter?

Regards, Scott T.

Looking for mature software developer to finish my Bruce Lee remake.. apply via email to MSN address.

Login to post a reply

Server time is: 2025-06-18 06:28:31
Your offset time is: 2025-06-18 06:28:31