Make function to access the Geodatabase elements date and size

1997
11
11-30-2022 02:43 PM
Status: Implemented
graharg_MAO
New Contributor III

The Geodatabase elements Name, Type, Date Modified, Size and Path can be viewed in ArcGIS PRO Catalog View.  Please add a function to access these element descriptions.  I would like to be able to post these descriptions in the Table of Contents show the data vintage can quickly be found.

graharg_MAO_0-1669848100585.png

 

11 Comments
JohnDye

It would be really nice to be able to return the 'File Size' and 'Date Modified' properties of a feature class through the arcpy.describe function. This would be really helpful in helping to ensure that users are current with their datasets.

something like:

importarcpy# Create a Describe object from the feature class#desc=arcpy.Describe("C:/data/arch.dgn/Point")# Print some feature class properties#print"File Size: "+desc.fileSizeprint"Date Modified : "+desc.dateModifiedprint"Read/Write: "+ desc.permissions
MicahBabinski
FYI, there is a geonet thread related to this topic. It can be accomplished using some ArcObjects integration with Python, but it would be wonderful if this idea were promoted and the functionality included in a future release of the software,
PhilLarkin1

After 4.5 years the answer from ESRI is....Meh. 

EricTran

This would add so much functionally with python scripting.  You can see If a feature class has changed file size, you can see any feature classes that have been updated in the last week, you can set up a check to see if there were any major changes in file size in the last week,  you can make a check to see if the feature class was updated the same day, then run the script if it was or return a  reminder to update the FC if it wasn't. Check to see if any FC's in a GDB has been updated in the last week and update all associated MXDs to services based on what was changed...

Sadly, after waiting for so long, I don't think ESRI's interested in adding that functionality.  So I'll be sticking with shape files if I ever want the convenience of that kind of file metadata.

JoshuaBixby

Phil Larkin‌, make that 6.5 years!  I will leave a note to my kid to check back when he is grown up because I think this request will outlive me.

RPGIS
by

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.

geomatix

Thank you!

HannesZiegler
Status changed to: In Product Plan

We're working on this!  This status does not guarantee that the functionality will be in the next release, but development work has begun. Release cycles vary by product so make sure to check the product life cycle information to get an idea of when to expect the next release.  

HannesZiegler
Status changed to: Implemented

This Idea has been implemented for featureclasses, tables, and shapefiles in ArcGIS Pro 3.2. The properties size, dateAccessed, dateCreated, and dateModified have been added to the Describe object (among others).

Please see the What's New documentation for more new features in Pro 3.2.

The Your Ideas in ArcGIS Pro 3.2 blog and video have been posted to the Esri Community blog. You can take a look at these to see your idea and all others that were implemented in this release of ArcGIS Pro.

AndrewRudin1

The implemented enhancements in ArcPy.Describe for Pro 3.2 don't return a dateModified property for feature classes in my 10.9.1 Oracle geodatabase.  Nor does it work for feature classes in my 10.9.1 Azure SQL Database.  It does for a file geodatabase feature class though. 

So really the enhancement is Arcpy describe will return size and dateModified if the underlying geodatabse supports it... and enterprise geodatabases (at least at 10.9.1) don't support it.

I assume this is because the SDE business tables don't contain any kind of auditing fields for date created or date modified for geodatabase items...because I've hunted for something like this and no luck. 

I'd be curious if the value would be returned by ArcPy if the Oracle geodatabase was at version 11.2.  But I assume those columns would have to be added to the SDE business schema somewhere and populated to make the data available for Arcpy to grab.  I could not find any documentation specific to what's new in enterprise geodatabase functionality at 11.2 so can't verify this was done.