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

Support for Android version of Total Commander

Moderators: sheep, Hacker, Stefan2, white

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 » 2017-03-15, 08:57 UTC

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: 38017
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-03-15, 10:31 UTC

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
http://www.ghisler.com

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

Post by *morty » 2017-03-15, 13:39 UTC

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: 38017
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-03-15, 17:00 UTC

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
http://www.ghisler.com

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

Post by *morty » 2017-03-17, 01:34 UTC

That did the trick. Thank you.
Probably you can fix the automatic update? :)

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38017
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-03-19, 09:19 UTC

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
http://www.ghisler.com

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

Post by *morty » 2017-03-21, 00:04 UTC

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: 38017
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2017-03-21, 07:54 UTC

Can you give me the exact path names and file names with which that happens?
Author of Total Commander
http://www.ghisler.com

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

Post by *morty » 2017-04-04, 20:52 UTC

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 » 2019-05-21, 22:03 UTC

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: 38017
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) » 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?
Author of Total Commander
http://www.ghisler.com

User avatar
Usher
Power Member
Power Member
Posts: 551
Joined: 2011-03-11, 10:11 UTC

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

Post by *Usher » 2019-05-23, 19:20 UTC

Bucic wrote:
2019-05-21, 22:03 UTC
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
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.
Regards from Poland
Andrzej P. Wozniak

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 » 2019-10-23, 20:23 UTC

Usher wrote:
2019-05-23, 19:20 UTC
Bucic wrote:
2019-05-21, 22:03 UTC
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
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 » 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.

sweetbox
Junior Member
Junior Member
Posts: 33
Joined: 2012-03-27, 11:56 UTC

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

Post by *sweetbox » 2019-10-26, 14:24 UTC

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