Copying locked file deletes target file without copying

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Copying locked file deletes target file without copying

Post by *StatusQuo »

Situation:
File N:\Exchange\adrbook.pab (personal address book), locked by running MS Exchange client 5.0,
shall be copied to a backup location (D:\backup\adrbook.pab)
TC Lister opens it without any error message, but just displays an empty window without the file's contents.

Problem:
While trying to copy the file (F5), the existing copy in the backup dir is successfully deleted (before copying), but the original file can't be read
:arrow: so the backup file is gone, the original file not accessible - the backup normally can't be restored/renewed until Exchange is closed :( .

Expected behaviour:
If the source file can't be read, the target file should not be deleted in copy/move operations.

Is maybe a special way of file locking by Exchange causing this problem?

Test results:
I get the same behaviour on a Samba drive, local NTFS drive and USB stick (NTFS),
with or without compatibility mode,
while copying (F5) or moving (F6).

TC displays:
- without compatibility mode:
Error: Cannot read N:\backup\adrbook.pab!
- with compatibility mode enabled:
Error: Cannot write D:\backup\adrbook.pab!
Please remove the write protection!
(Although the mentioned target file doesn't exist any more - the same message appears if the target is an empty directory.)


[Edit: added test results regarding compatibility mode + moving]
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is a known problem, and there is NO solution to it. Why?

Exchange does NOT lock the entire file. It locks certain records in it. So opening the file will succeed, but reading from the file will fail somewhere in the middle! TC would have to read the entire file from beginning to end to be sure that it can read it, but this isn't feasible...
Author of Total Commander
https://www.ghisler.com
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

I see, thanks for the details.

I guess, I'll use a two-step copy for these files then (copy to a temp location, if successful: copy this to backup target).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
Post Reply