0

lets say that some files were renamed by Python script, is it possible to get this 'rename time' using Python (It can be seen in Far Manager)? (Windows)

It seems it is not possible through STAT, etc Any ideas ?

illegal-immigrant
  • 8,089
  • 9
  • 51
  • 84
  • 1
    This doesn't really have anything to do with Python, so you should remove that tag – John La Rooy Mar 31 '11 at 10:58
  • Why? I want to get file info ('rename time' using Python) ? I thought It is related to Python programming language – illegal-immigrant Mar 31 '11 at 10:59
  • How can you see the time when the files were renamed using Far Manager? – Cristian Ciupitu Mar 31 '11 at 11:21
  • 4
    No file system I'm aware of keeps track of file rename time. You are misinterpreting what you are seeing. The closest thing you can get is modification time of the directory containing the file; you won't be able to distinguish renamings of several files, though (or renamings from other kinds of directory modification). – atzz Mar 31 '11 at 11:24
  • possible duplicate of [How to get file creation & modification date/times in Python?](http://stackoverflow.com/questions/237079/how-to-get-file-creation-modification-date-times-in-python) – Wooble Mar 31 '11 at 13:03
  • Wooble>>Not a duplicate, I asked about a way to get 'rename time', OS does not register it as 'modification', so modification is not the thing atzz>>Post this as an answer, I'll accept it. Thanks – illegal-immigrant Mar 31 '11 at 16:02

2 Answers2

0

If you're asking how to get the modification date of the file, it's this:

>>> import os
>>> import datetime
>>> stat = os.stat('/tmp/bacon')
>>> print datetime.datetime.fromtimestamp(stat.st_mtime)
2011-03-31 08:02:52.953873
jathanism
  • 33,067
  • 9
  • 68
  • 86
0

It is impossible, OS does not store such info about files. Answered by 'atzz' in comment

illegal-immigrant
  • 8,089
  • 9
  • 51
  • 84