Can someone please specify what is the difference between os.path.getmtime(path)
and os.path.getctime(path)
in unix systems . As per the defnition in python docs:
os.path.getmtime(path)
Return the time of last modification of path. The return value is a number giving the number of seconds since the epoch (see the time module). Raise os.error if the file does not exist or is inaccessible.
os.path.getctime(path)
Return the system’s ctime which, on some systems (like Unix) is the time of the last change, and, on others (like Windows), is the creation time for path. The return value is a number giving the number of seconds since the epoch (see the time module). Raise os.error if the file does not exist or is inaccessible.
Does that basically mean they are the same things when used in unix/systems?
#!/usr/bin/python
import os
print os.path.getmtime('File')
print os.path.getctime('FIle')
Both the prints fetch me the same value.
I am basically looking for last creation date for file , rather than last modification date. Is there a way to achieve the same in unix?