<br><br><div class="gmail_quote">On Thu, Apr 2, 2009 at 12:36 PM, Gabriel <span dir="ltr"><<a href="mailto:dunmer@dreams.sk">dunmer@dreams.sk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
I have to write linux application that will analyze disk/partition (ext3 filesystem) on really low level. It has to find/analyze files on the disk by reading disk blocks to analyze file's headers to find out file type and  then blocks related to file to  get file content. The second part have to be searching deleted files by this blocks reading (is this even possible?)<br>

<br>
Can i do this in python? For example can i open disk image file and read it block by block?<br>
Or is there even better solution? .) I tried search web but I wasn't successful..<br>
<br>
I will appreciate any help. Thank you in advice..<br>
<br>
Gabriel<br><font color="#888888">
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a></font></blockquote><div><br>I may be wrong, but I'd assume that you could just read by block size, opening the file that represents the disk in /dev (/dev/sda or similar). I don't see why you would want to do that to find out file type/headers though. You should be able to see the contents of "deleted" files that haven't been (entirely) overwritten on disk - I believe that when you delete a file, you really just delete the inode, or reference that tells the filesystem that there's a file there.<br>
<br>Someone else who's keener on the details of these things will probably come with better information. <br></div></div>