Just a small comment :
To make the file recovery "even better", you might want to prevent any writing at all to disk (except swap space) while you are trying to recover the missing file(s), so I would try to buffer all files in memory until you have read everything out from the device in question (in your case, /dev/sda6. Of course, once you take this step, you will also want to consider restoring multiple files (from an erroneous rm -rf foo/ for example), and soon your short hack turns into a big fat program itself :-)