WinInet API: Accessing a file on FTP for Reading
From: Rashid (mrashidsaleem_at_hotmail.com)
Date: 06/02/04
- Next message: Puzzolino: "Re: Keepalives"
- Previous message: Tiger on prowl: "Experts guide"
- Messages sorted by: [ date ] [ thread ]
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)?
- Next message: Puzzolino: "Re: Keepalives"
- Previous message: Tiger on prowl: "Experts guide"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|