copy process stops due to overwriting 0 byte file

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
juno12
Junior Member
Junior Member
Posts: 19
Joined: 2013-01-03, 17:06 UTC

copy process stops due to overwriting 0 byte file

Post by *juno12 »

This problem exists for me since a longer time, not starting with 11.03 beta.
When I'm copying a selection of files to a network drive, I often experience a warning message if I like to overwrite a 0 byte (with actual time) version of the file I want to copy. But this file is created during the copy process itself and did not exist before.
I have the impression, that this happens more often having slower network connections (over VPN).
In the configuration I have checked "Use standard copy method (recommended)"
Is there a setting to avoid this?

TC 11.03 (and earlier) 64-bit, Win10 22H2 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: copy process stops due to overwriting 0 byte file

Post by *ghisler(Author) »

The recommended copy method uses the Windows function CopyFileEx to copy files. It creates a new file, sets the file size to that of the source to allocate the necessary space, then copies the data and finally the timestamp. I have never had any reports that it would create empty files. Maybe the network connection is unstable and broke when creating the new file? Or a security software on the other computer stopped the creation of the file? Unfortunately I can only speculate here, I don't have enough information to find the reason, sorry.
Author of Total Commander
https://www.ghisler.com
juno12
Junior Member
Junior Member
Posts: 19
Joined: 2013-01-03, 17:06 UTC

Re: copy process stops due to overwriting 0 byte file

Post by *juno12 »

This happened in variable constellations on different computers with different virus protections:
- Copy to a network share of a windows server 2022 in another LAN connected via Open-VPN
- Copy to an external NAS (WD MyCloud) in another LAN (2 via VPN connected fritz boxes)

Last case is reproducible right now. Ich will check further errors and try to get more details.
I don’t believe that it is an instability, since this is the only problem using this LAN connection. And it is always the same error with 0 bytes. I guess it might be a timing problem.
When I use "Use default method only" instead of "Use standard copy method (recommended)" there is no problem.
But this labeled "not very fast", so I don't want to use this for all copy processes.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: copy process stops due to overwriting 0 byte file

Post by *ghisler(Author) »

Maybe you can see with Sysinternals "Process Monitor" what is going on. Just filter by process containing totalcmd. It should show you what error CopyFileEx is returning.
Author of Total Commander
https://www.ghisler.com
juno12
Junior Member
Junior Member
Posts: 19
Joined: 2013-01-03, 17:06 UTC

Re: copy process stops due to overwriting 0 byte file

Post by *juno12 »

Thanks for the hint with ProcMon. But I can’t find the entry CopyFileEx in the log.
I’m right now looking for differences between working and stopped copy processes, but the log is long :wink:
And I realized that copying the file
c:\utils\SysinternalsSuite\Procmon64.exe to the NAS always is stopped, but
c:\utils\SysinternalsSuite\test\Procmon64.exe to the NAS always works.
A bit hard to understand what might be the reason for this.
tdklaus
Junior Member
Junior Member
Posts: 36
Joined: 2003-02-14, 11:07 UTC

Re: copy process stops due to overwriting 0 byte file

Post by *tdklaus »

Sorry if this may be too obvious, but have you verified that both the sending and the reciving file systems are healthy? (chkdsk/fsck)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: copy process stops due to overwriting 0 byte file

Post by *ghisler(Author) »

Try searching for CreateFile or for the file name of the file you were trying to copy (in ProcMon).
Author of Total Commander
https://www.ghisler.com
juno12
Junior Member
Junior Member
Posts: 19
Joined: 2013-01-03, 17:06 UTC

Re: copy process stops due to overwriting 0 byte file

Post by *juno12 »

File systems are all healthy.
Right now I can reproduce the error only with the network shares on the NAS.
I will check this more detailled with ProcMon at the weekend.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: copy process stops due to overwriting 0 byte file

Post by *ghisler(Author) »

I don't think that there is a way for me to fix this,sorry.

Moderator message

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
Post Reply