Are there any programs that can help identify files and directories belonging to unfinished bittorrent-downloads? I've made a mess, and I'm unsure of which downloads are finished and which are not. I could obviously use the bt-client, if I still had the torrent-files, but I don't. I'm therefor looking for way to identify likely unfinished bt-downloads – doesn't have to be 100% accurate.
I've noticed that bt-clients typically create empty-files, as well as leave files with "holes" (blocks of the file with just NULL-characters), so this could perhaps be a good way to find likely candidates. Sadly, I don't know any good Linux-commands for finding files with blocks of NULLs…
Best Answer
If your grep supports it; you could do a check by grep.
Where NNN is how many continuously zero bytes you want to match. Would typically be max USHRT_MAX or 65535.
-P
is needed to use\x00
To list offsets use:
So something in the direction of:
Else you could use
hexdump
,xxd
or the like and match for000...
.But that would be crazy slow.
Finally a very short C program could do the same.