Skip to content

Commit

Permalink
set created_time to None if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jun 10, 2017
1 parent f040872 commit 6b78709
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ def _make_details_from_stat(cls, stat_result):
'size': stat_result.st_size,
'type': int(cls._get_type_from_stat(stat_result))
}
if hasattr(stat_result, 'st_birthtime'):
details['created'] = stat_result.st_birthtime
# On other Unix systems (such as FreeBSD), the following
# attributes may be available (but may be only filled out if
# root tries to use them):
details['created'] = getattr(stat_result, 'st_birthtime', None)
ctime_key = (
'created'
if _WINDOWS_PLATFORM
Expand Down

0 comments on commit 6b78709

Please sign in to comment.