AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting (raw) FTP file listing

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
CyberRax



Joined: 25 Jan 2008
Posts: 1

PostPosted: Fri Jan 25, 2008 4:25 pm    Post subject: Getting (raw) FTP file listing Reply with quote

Hi! My goal is to get the file listing from a remote FTP server, but I don't know where to start. Had a look on the DllCall: Basic FTP Functions
thread, but as far as I can tell the method of using FTP_FindFirstFile/FTP_FindNextFile loop is rather cumbersome and, to my understanding, puts a too heavy load on the server (the server I'm intending to use it on already services a lot of users and generates the listing xx times a second due the constant requesting by connected FTP clients).
I'd preffer to get something like the output of "list" command or what PHP's ftp_rawlist() delivers, which ought to more CPU-friendly on the server's side. Is that possible and if yes then how to implement this?
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Mon Feb 18, 2008 1:07 pm    Post subject: Reply with quote

The second example for FileAppend demonstrates how you can use ftp.exe to execute server commands.
_________________

Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Mon Feb 18, 2008 3:19 pm    Post subject: Re: Getting (raw) FTP file listing Reply with quote

CyberRax wrote:
My goal is to get the file listing from a remote FTP server...

...ok, see my code here...
...(btw, sorry, I forgot to reply the 1st time I saw this topic...only noticed it again since Titan bumped it)...
Back to top
Murp|e



Joined: 12 Jan 2007
Posts: 261
Location: Norway

PostPosted: Mon Feb 18, 2008 3:29 pm    Post subject: Reply with quote

You will need to use the "ls" command which does exactly what you want namely "List files in remote directory".

I've been wanting to write a really simple FTP script that will allow me to drop files on to a window to have them uploaded to a predefined folder (a sort of online temp folder) and possibly list the existing files.

Libcurl can be used for uploading via FTP and report the progress of the upload/download. There's another thread about this in the forums by olfen. I think I asked him for some more examples of how to use libcurl with FTP.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group