parse tar file with python

Shagshag13 shagshag13 at yahoo.fr
Thu Jun 13 07:44:14 EDT 2002


In fact, i don't want to tar/untar files, and especially not in main memory !

I wish i could read the tar-ed file line by line (f.readline) and be able to check when i find the beginning of an "inside file" and
get some info about it like name, how and so on... (that's because my original files are plain text file, and i think that tar will
let them unchanged)

In my tar file there is, for example, a kind of separator like this (but with everything in one long line) with :

shag.py_0100744_0002033_0001750_00000004414_07500237361_0015314_0_ustar_00_shagshag_user_0000040_0000417_beginofmyfilehere

where _ stand for a variable amount of another ascii code that i can't cut/paste...

Do you kwow what each means (for example the first one is undoubtly the file name, but then...) ?
And what are the fixed position of each of theses ?
Have a clue ?

Many thanks,

s13.








More information about the Python-list mailing list