Re: Help. In ftp sessions, how to refresh directory list?



This was for the PUT process. The coder of the example inline comment probably means that if you are doing any directory listing, it needs be refresh (listed again) in order to see the posted file. It is probably just a comment because this example was pulled from a more extensive example.

For example, if you wrote a FTP GUI program and you started it, connected to a ftp site, it will most likely start by listing the current directory. So you begin a PUT process, and having his note on the on the successful return TRUE, probably triggers a GUI refresh of the directory so you can see the newly posted file.

Same would true for any change in the directory (delete or rename). If successful, you should update the current directory listing. If FALSE, there is no need to refresh it because nothing changed.

The whole idea is akin to the typical console method:

ftp> DIR <---- list the directory
ftp> PUT afile <--- put a file
ftp> DIR <----- relist it to see the new file

For the WININET.DLL library, the FTP user command "DIR" translates to a FTP SERVER "LIST" command, and to WININET.DLL does an emulation of the FindFirstFile()/FindNextFile()/FindClose() APIs.

It is a SNAP SHOP, meaning, it does the ftp LIST in the background and then parses each ftp server response line which can be in various formats, to produce an internal list of WIN32_FIND_DATA records.

It begins this process with FtpFindFirstFile() and the successful return results with the first record from the WIN32_FIND_DATA internal list, and when you call InternetFindNextFile(), it gets the next record in the list, and so on. In the end, you InternetCloseHandle() to clean up the process.

--
HLS

Larry wrote:
I read a document about FTP Sessions in MSDN.


http://msdn2.microsoft.com/en-us/library/aa384180.aspx


In the document, if you upload a file to FTP server, delete or rename
a file on FTP server, you need to remember to refresh directory
listing.


In the sample source code there is just a comment: // Remember to
refresh directory listing. But how to do it in C++? Just send a LIST
ftp command or use FtpFileFinder to enumerate the files on FTP
server?

Laurence

.



Relevant Pages

  • Re: access Outlook Web Access without authentication
    ... Because I didn't want to set up a webserver, the file is hosted on our FTP ... In the same HTML file we load the calendar into an iframe: ... I've never use ftp:// in a meta refresh tag like that. ... getting via ftp) on the default web site of your Exchange server? ...
    (microsoft.public.exchange.misc)
  • Re: access Outlook Web Access without authentication
    ... I've never use ftp:// in a meta refresh tag like that. ... getting via ftp) on the default web site of your Exchange server? ... the credentials in the URL, I need to provide them the first time, but I ...
    (microsoft.public.exchange.misc)
  • Re: long ftp dir listings
    ... > I am often annoyed trying to get a long directory listing from my unix box ... I often resort to using ftp in Windows DOS mode so I can scroll ... I use zsh's built in ftp. ... autoload -U zfinit ...
    (freebsd-questions)
  • RE: vsftpd Questions.
    ... FTP access, I want her not to sshinto my system using that user ... After this " Here comes the directory listing" message the directory listing ... directory instead of the respective user's home directory. ... -- redhat-list mailing list unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe ...
    (RedHat)
  • Re: access Outlook Web Access without authentication
    ... Because I didn't want to set up a webserver, the file is hosted on our FTP ... So now I'm wondering if there's no way to make said calendar accessible to ... I've never use ftp:// in a meta refresh tag like that. ... getting via ftp) on the default web site of your Exchange server? ...
    (microsoft.public.exchange.misc)