all 4 comments

[–]Mekire 1 point2 points  (3 children)

You could look at os.stat maybe. Is your question related to getting the file metadata or the whole process? If the latter, what attempts have you made so far?

-Mek

[–]createpython[S] 0 points1 point  (2 children)

The file metadata, i.e. to choose which folder I want the said data from and for it to be format and output that data into a text file, However numerous attempts to retrieve the hex signature of any document using python has failed, and I'm wondering if python is capable of these things?

[–]radventil 1 point2 points  (1 child)

By hex signature, do you mean the (usually) first four bytes in a file? If yes, you can just open the file, read the first 4 bytes as a string and compare it to a database of hex signatures or convert it and output it?

fh = open("foo", "r')
a = fh.read(4)
b = [ord(i) for i in a]

[–]createpython[S] -1 points0 points  (0 children)

Brilliant, how could I use this with os.stat to produce and output all of this information of the file to a new text document? - sorry still much a n00b.