Question

I have in a folder several files which are unfinished torrent files. On a HFS filesystem the du command returns the size of the file as if it has not hole in it.

How do you compute the ratio between the empty blocks and the block with actual data in them ? So far I'm doing this by dividing the size of a fast gzip compressed version of the file by the apparent size.

I'm not writing an application. I'm trying to find which files created by transmission (a bittorent client) are not complete.

No correct solution

OTHER TIPS

ls -ksl filename will display the actual allocated on-disk space in the first column, in kilobytes (not bytes). A sparse file will have allocated space less than the actual size of the file, but having a greater-or-equal allocated size does not guarantee that the file has been fully downloaded, just that each block of the file has had something written to. To verify if the file has been fully downloaded, you should validate the checksum from the .torrent file, which some command-line torrent clients can do for you (e.g. ctorrent -c, available from Homebrew or MacPorts).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top