Bug?: Copied files show with 0 bytes on PC connection

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

morty
Junior Member
Junior Member
Posts: 5
Joined: 2017-03-13, 12:29 UTC

Bug?: Copied files show with 0 bytes on PC connection

Post by *morty »

Hi, i copied some files from one folder on the SD card to another folder using the copy button. This did work nicely at first glance.
They were accessible on my android device without any restriction, e.g. if media files are copied, they show up in the viewer ok.

But when i connect with USB to a PC (MTP) the copied files show up with 0 byte length in windows explorer or total commander.
They also can't be accessed which you might think would work with a symbolic link.

So i don't know what happened here.

I would guess the copy did indeed create symbolic links, but those aren't supported on the USB connection.
On the other hand the copied files do not look in any regard special when viewed on android total commander (no symbol that would indicate a link, file size is ok).
Ah i just recognized the anroid file manager shows a 0 byte length either.

Where's the switch to do a physical copy instead to create links (if this really is what happened here).

Used OS: 6.0, TC: 2.80b7 (but "defective" files were copied with older versions too).

Otherwise: Good work keep it up, registered user since more than a decade :-)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

That's odd, TC tells Android to re-read the media cache (that's what Windows sees, not the actual file system).

Does it work when you unplug and reconnect the device to your PC?
Author of Total Commander
https://www.ghisler.com
morty
Junior Member
Junior Member
Posts: 5
Joined: 2017-03-13, 12:29 UTC

Post by *morty »

ghisler(Author) wrote:That's odd, TC tells Android to re-read the media cache (that's what Windows sees, not the actual file system).

Does it work when you unplug and reconnect the device to your PC?
The copies were made over weeks. Before that time i copied with the Android file manager which did work as expected. I switched to total commander and all the files i copied since are like i described.

I'd like to mention again that anroid file manager shows a 0 byte length either for the copies made with TC.

From your answer i assume you use a "low-level" copy function and anrdoid fails to sync some cache. Hmm, what can i give you for more debugging? Can i resync that media cache manually? (i have no root).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You can try to reload them manually in the media database:

In Android TC, create a new button, choose type "Internal command" and click on >> to pick command Nr. 130 (Refresh).

Then select the affected files/folders and tap on the button.
Author of Total Commander
https://www.ghisler.com
morty
Junior Member
Junior Member
Posts: 5
Joined: 2017-03-13, 12:29 UTC

Post by *morty »

That did the trick. Thank you.
Probably you can fix the automatic update? :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC calls the exact same function after copying a file. I don't know why this doesn't work for you...
Author of Total Commander
https://www.ghisler.com
morty
Junior Member
Junior Member
Posts: 5
Joined: 2017-03-13, 12:29 UTC

Post by *morty »

Hm funny then.. any chance i can give some additional input?
Is there some debug-log TC can store somewhere?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Can you give me the exact path names and file names with which that happens?
Author of Total Commander
https://www.ghisler.com
morty
Junior Member
Junior Member
Posts: 5
Joined: 2017-03-13, 12:29 UTC

Post by *morty »

Sorry for the delay... seems to happen to all media files on the SD-Card regardless the name or exact path...
Bucic
Junior Member
Junior Member
Posts: 4
Joined: 2010-03-23, 14:16 UTC
Location: Poland

Re: Bug?: Copied files show with 0 bytes on PC connection

Post by *Bucic »

Maybe what I'm experiencing is somewhat related. I'm not entirely sure but after losing a bunch of my photos I think in my case it goes like this:
1. TC used to move photos (with move command) from internal memory DCIM/Camera to <sdcard>/DCIM/Camera
2. After days or weeks: connected to PC via USB, File transfer mode, photos are moved (move command again, in Windows 7) from <sdcard>/DCIM/Camera to a directory on PC.

The result:
Files are being moved (they disappear from the phone's sd card) but the resultant files on the PC have 0 bytes and are unreadable. The last time it happened to a batch of my photos and videos the problem affected only photos. Videos were moved correctly.


Confguration:
Sandisk 32 GB SD card formatted to exFAT 32 KB allocation size
(since the last hiatus I re-formatted the card to FAT32 32 KB allocation size
LineageOS 14.1
Moto X Play

EDIT:
This issue effectively leads to data loss.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Bug?: Copied files show with 0 bytes on PC connection

Post by *ghisler(Author) »

I'm currently not aware of any bugs in Total Commander or Android which could be causing this. Can you still open the photos on the card within Android?
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Bug?: Copied files show with 0 bytes on PC connection

Post by *Usher »

Bucic wrote: 2019-05-21, 22:03 UTCConfguration:
Sandisk 32 GB SD card formatted to exFAT 32 KB allocation size
(since the last hiatus I re-formatted the card to FAT32 32 KB allocation size
LineageOS 14.1
Moto X Play
This issue effectively leads to data loss.
Due to license limitations there may be problems with support for SD/SDHC/SDXC cards using non-default format. You should expect data loss when using such cards in photo cameras and other non-PC devices. Some devices may work OK but delete all data written to folders created by other devices or re-format card.
Andrzej P. Wozniak
Polish subforum moderator
Bucic
Junior Member
Junior Member
Posts: 4
Joined: 2010-03-23, 14:16 UTC
Location: Poland

Re: Bug?: Copied files show with 0 bytes on PC connection

Post by *Bucic »

Usher wrote: 2019-05-23, 19:20 UTC
Bucic wrote: 2019-05-21, 22:03 UTCConfguration:
Sandisk 32 GB SD card formatted to exFAT 32 KB allocation size
(since the last hiatus I re-formatted the card to FAT32 32 KB allocation size
LineageOS 14.1
Moto X Play
This issue effectively leads to data loss.
Due to license limitations there may be problems with support for SD/SDHC/SDXC cards using non-default format. You should expect data loss when using such cards in photo cameras and other non-PC devices. Some devices may work OK but delete all data written to folders created by other devices or re-format card.
I have already established the problem has nothing to do with non-standard formatting I was using. The problem occured again with default formatting, FAT32 etc. Please stay tuned. I'll be providing more details.
Bucic
Junior Member
Junior Member
Posts: 4
Joined: 2010-03-23, 14:16 UTC
Location: Poland

Re: Bug?: Copied files show with 0 bytes on PC connection

Post by *Bucic »

ghisler(Author) wrote: 2019-05-23, 09:18 UTC I'm currently not aware of any bugs in Total Commander or Android which could be causing this. Can you still open the photos on the card within Android?
Yes. It seems that only the USB - Transfer files (PC connect) mode is affected. Please read on.

Sorry for the belated response. I forgot to set up notifications. Let's get on with it.

Steps I followed to trigger the occurence of the bug again:
1. Take photos as usual, with my usual app.
2. Use Totalcmd for Android to move photos from internal memory DCIM\Camera to SD card DCIM\Camera

I also confirmed the following to be irrelevant:
1. A different PC or system (tested W10 and W7, W7 on two PCs).
2. Time interval between the Totalcmd move operation and the bug occurence. I can jump into USB - Transfer files mode after seconds or after a month, it doesn't matter. Files moved to SD card using Totalcmd will be 0 byte in size when viewed in USB - Transfer files mode.
3. SD card file system and unit allocation size (cluster size) : the problem occured on a default FAT32 format as well as exFAT and NTFS with at least one case of a non-standard (increased) cluster size.

Expected result:
The files moved to SD card readable on mobile, in a card reader and via USB - Transfer files.

Actual result:
The files moved to SD card are readable on mobile and in a card reader, with normal file sizes but are inaccessible via USB - Transfer files (file sizes indicated as 0 bytes).


I have confirmed that the problem is triggered by Totalcmd. I have used USB - Transfer files for months to move my photos from internal memory to SD card. As soon as I used Totalcmd for a certain batch of photos I noticed the 0 byte problem.

I also prepared a set of files comprised of intact files copied over by using an SD card reader and the same files turned into 0 byte files by copying them via USB - Transfer files on my PC.
https://1drv.ms/u/s!AvyUQyNGJs9mket0Jl8mwBYTpmLxnA?e=u3lR7w

Note:
I do not have an additional SD card but nothing else suggests it's the culprit. I've been using it in many different scenarios without a glimpse of a problem.
sweetbox
Junior Member
Junior Member
Posts: 34
Joined: 2012-03-27, 11:56 UTC

Re: Bug?: Copied files show with 0 bytes on PC connection

Post by *sweetbox »

Bucic wrote: 2019-10-25, 20:25 UTC
ghisler(Author) wrote: 2019-05-23, 09:18 UTC I'm currently not aware of any bugs in Total Commander or Android which could be causing this. Can you still open the photos on the card within Android?
Yes. It seems that only the USB - Transfer files (PC connect) mode is affected. Please read on.

Sorry for the belated response. I forgot to set up notifications. Let's get on with it.

Steps I followed to trigger the occurence of the bug again:
1. Take photos as usual, with my usual app.
2. Use Totalcmd for Android to move photos from internal memory DCIM\Camera to SD card DCIM\Camera

I also confirmed the following to be irrelevant:
1. A different PC or system (tested W10 and W7, W7 on two PCs).
2. Time interval between the Totalcmd move operation and the bug occurence. I can jump into USB - Transfer files mode after seconds or after a month, it doesn't matter. Files moved to SD card using Totalcmd will be 0 byte in size when viewed in USB - Transfer files mode.
3. SD card file system and unit allocation size (cluster size) : the problem occured on a default FAT32 format as well as exFAT and NTFS with at least one case of a non-standard (increased) cluster size.

Expected result:
The files moved to SD card readable on mobile, in a card reader and via USB - Transfer files.

Actual result:
The files moved to SD card are readable on mobile and in a card reader, with normal file sizes but are inaccessible via USB - Transfer files (file sizes indicated as 0 bytes).


I have confirmed that the problem is triggered by Totalcmd. I have used USB - Transfer files for months to move my photos from internal memory to SD card. As soon as I used Totalcmd for a certain batch of photos I noticed the 0 byte problem.

I also prepared a set of files comprised of intact files copied over by using an SD card reader and the same files turned into 0 byte files by copying them via USB - Transfer files on my PC.
https://1drv.ms/u/s!AvyUQyNGJs9mket0Jl8mwBYTpmLxnA?e=u3lR7w

Note:
I do not have an additional SD card but nothing else suggests it's the culprit. I've been using it in many different scenarios without a glimpse of a problem.

Android version?
Maybe it's android problem that usb-transfer.
Try android settings --- storage --- unmount sd-card --- mount sd-card ,that will reflash the new files arrived to sd-card.
Post Reply