Programmatically return Feature Class file size and date modified

17567
30
05-21-2013 06:19 AM
JohnDye
Occasional Contributor III
There doesn't appear to be a function in arcpy to return the file size of a feature class or it's date modified timestamp.

Anyone have any idea how to do this? I know there is a property somewhere because you can setup ArcCatalog to display the information. However, I want to see it returned in a Python Script so that I can write a two-way synchronization function.
Tags (2)
30 Replies
RPGIS
by
Occasional Contributor III

Here is some documentation that will allow for you to export any file information regarding the database.

Get file information via python 

os.path.getatime(path)

Return the time of last access of path. The return value is a floating point number giving the number of seconds since the epoch (see the time module). Raise OSError if the file does not exist or is inaccessible.

os.path.getmtime(path)

Return the time of last modification of path. The return value is a floating point number giving the number of seconds since the epoch (see the time module). Raise OSError if the file does not exist or is inaccessible.

Changed in version 3.6: Accepts a path-like object.

os.path.getctime(path)

Return the system’s ctime which, on some systems (like Unix) is the time of the last metadata 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 OSError if the file does not exist or is inaccessible.

Changed in version 3.6: Accepts a path-like object.

os.path.getsize(path)

Return the size, in bytes, of path. Raise OSError if the file does not exist or is inaccessible.

Changed in version 3.6: Accepts a path-like object.

0 Kudos