|
-
CopyFileEx Fails to copy & deletes target file if source file is Open
I have written a little backup program. When a file is open it will not copy.
The CopyFileEx API Call Fails. I even used the COPY_FILE_OPEN_SOURCE_FOR_WRITE option.
If I open the file first using CreateFileA for GENERIC_READ
with Share Mode of:
FILE_SHARED_READ OR FILE_SHARED_WRITE,
and the CreationDisposition is: OPEN_EXISTING,
with attributes set to: FILE_ATTRIBUTE_NORMAL
Then the file opens successfully. Which I then close with CloseHandle.
But still when I try to use CopyFileEx it fails to copy the file.
What is even worse is that to old version of the file stored on the backup drive gets erased.
Similar Threads
-
Replies: 7
Last Post: 10-18-2005, 05:14 PM
-
By Anonymous in forum Open Source
Replies: 0
Last Post: 05-25-2002, 01:53 AM
-
By Anonymous in forum Open Source
Replies: 0
Last Post: 05-12-2002, 09:05 PM
-
By Anonymous in forum Open Source
Replies: 0
Last Post: 04-24-2002, 01:20 AM
-
By Tomer Cagan in forum ASP.NET
Replies: 1
Last Post: 07-24-2001, 09:01 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks