Re: [ OT ] WinInet API: Accessing a file on FTP for Reading
From: Chris \( Val \) (chrisval_at_bigpond.com.au)
Date: 06/02/04
- Next message: Gianni Mariani: "Re: [Long, historical] Re: Var* b or Var *b"
- Previous message: Gianni Mariani: "Re: WinInet API: Accessing a file on FTP for Reading [OT]"
- In reply to: Rashid: "WinInet API: Accessing a file on FTP for Reading"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Gianni Mariani: "Re: [Long, historical] Re: Var* b or Var *b"
- Previous message: Gianni Mariani: "Re: WinInet API: Accessing a file on FTP for Reading [OT]"
- In reply to: Rashid: "WinInet API: Accessing a file on FTP for Reading"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|