WinInet API: Accessing a file on FTP for Reading

From: Rashid (mrashidsaleem_at_hotmail.com)
Date: 06/02/04


Date: 2 Jun 2004 05:52:32 -0700

I am using WinInet APIs to access a file on an FTP server (using
InternetOpen, InternetConnect, FtpOpenFile). Before downloading, I
want to make sure that the file I am accessing is not being written by
any other process at the same time. If somebody is uploading a large
file, I dont want my process to read partially-written file. I have
tried FtpRenameFile (e.g. renaming file abc.txt to the same name
abc.txt). This works in most cases and guarantees that no other
process is accessing the file, but some ftp servers refuse to rename
the file to same name. I can not change the name of the file. Is there
a better alternative (like the one provided by CreateFile windows API
through FILE_SHARE_READ, FILE_SHARE_WRITE flags)?



Relevant Pages

  • WinInet API: Accessing a file on FTP for Reading
    ... I am using WinInet APIs to access a file on an FTP server (using ... InternetOpen, InternetConnect, FtpOpenFile). ... Before downloading, I ...
    (alt.comp.lang.learn.c-cpp)
  • Re: [ OT ] WinInet API: Accessing a file on FTP for Reading
    ... |I am using WinInet APIs to access a file on an FTP server (using ... | InternetOpen, InternetConnect, FtpOpenFile). ... | a better alternative (like the one provided by CreateFile windows API ...
    (alt.comp.lang.learn.c-cpp)
  • Re: WinInet API: Accessing a file on FTP for Reading [OT]
    ... > I am using WinInet APIs to access a file on an FTP server (using ... > InternetOpen, InternetConnect, FtpOpenFile). ... If somebody is uploading a large ...
    (alt.comp.lang.learn.c-cpp)
  • Re: How to use FTP functions
    ... // Connect to FTP server. ... // Remove any existing target file from the file system. ... > LPCTSTR lpszProxyName, ... > But I'm getting error code 12029 in the function InternetConnect(). ...
    (microsoft.public.windowsce.platbuilder)
  • Re: shell command stays in memory
    ... >executable doesn't disappear from the memory even after its work (its work ... With the WinInet APIs, ... an FTP transfer entirely within your application. ... InternetConnect ...
    (microsoft.public.win32.programmer.kernel)

Loading