DiskXtender and colour ls
Jan. 10th, 2008 09:27 pmI'm feeling appropriately smug today: after a chance conversation with one of my cronies about the problems of spotting migrated files, I've come up with a patch for GNU
The code uses a neat heuristic to spot purged files, which relies on the fact that when DiskXtender clears a file, it changes the block count. Thus, if the actual block count of a file is much lower than the expected block count, based on the size of the file and if the block count also matches the DX stub size (the portion of the file that gets left on disc to deal with commands like
ls that tags purged files with a suitably lurid colour.The code uses a neat heuristic to spot purged files, which relies on the fact that when DiskXtender clears a file, it changes the block count. Thus, if the actual block count of a file is much lower than the expected block count, based on the size of the file and if the block count also matches the DX stub size (the portion of the file that gets left on disc to deal with commands like
file), then it is a pretty safe assumption that the file has been purged. Quick and dirty it may be but, unlike other more correct methods, it has the advantage that it works over NFS.