4 ms·
Say I have an original file: AAAAAAAAXAAAAAAA If I split it into two files, $1 and $2 that look like this: $1 - AAAAAAAA $2 - AAAAAAA I have now "saved" one b
by quasse 14y ago
Say I have an original file: AAAAAAAAXAAAAAAA
If I split it into two files, $1 and $2 that look like this:
$1 - AAAAAAAA
$2 - AAAAAAA
I have now "saved" one byte by dropping the X.
The script "cat $1 printf "X" cat $0 exit" will combine those two files and reinsert the X, thus "decompressing" the data. Basically, he has replaced the byte "X", which counted towards the total size, with the EOF marker on the filesystem, which technically didn't count.
No space was actually saved, because he basically moved the information from the X character to metadata (the file splits).