| View previous topic :: View next topic |
| Author |
Message |
CyberRax
Joined: 25 Jan 2008 Posts: 1
|
Posted: Fri Jan 25, 2008 4:25 pm Post subject: Getting (raw) FTP file listing |
|
|
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 |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Mon Feb 18, 2008 1:07 pm Post subject: |
|
|
The second example for FileAppend demonstrates how you can use ftp.exe to execute server commands. _________________
 |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Feb 18, 2008 3:19 pm Post subject: Re: Getting (raw) FTP file listing |
|
|
| 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
|
Posted: Mon Feb 18, 2008 3:29 pm Post subject: |
|
|
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 |
|
 |
|