Re: [ OT ] WinInet API: Accessing a file on FTP for Reading

From: Chris \( Val \) (chrisval_at_bigpond.com.au)
Date: 06/02/04


Date: Thu, 3 Jun 2004 00:35:31 +1000


"Rashid" <mrashidsaleem@hotmail.com> wrote in message
news:2afbbd12.0406012209.569b65ae@posting.google.com...
|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)?

This is off topic for this group, but you can achieve
what you want through Windows Scripting, and in particular
Windows Management Instrumentation "WMI" - There are a great
deal off excellent tutorials and tools for this stuff on the
Microsoft web site.

Good luck.
Chris Val



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)
  • 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 ...
    (microsoft.public.win32.programmer.networks)
  • 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)