Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on OSX the file creation date not available in os.stat #52250

Closed
klankschap mannequin opened this issue Feb 23, 2010 · 5 comments
Closed

on OSX the file creation date not available in os.stat #52250

klankschap mannequin opened this issue Feb 23, 2010 · 5 comments
Assignees
Labels
OS-mac type-feature A feature request or enhancement

Comments

@klankschap
Copy link
Mannequin

klankschap mannequin commented Feb 23, 2010

BPO 8002
Nosy @ronaldoussoren

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/ronaldoussoren'
closed_at = <Date 2010-04-18.19:36:22.908>
created_at = <Date 2010-02-23.15:21:31.070>
labels = ['OS-mac', 'type-feature']
title = 'on OSX the file creation date not available in os.stat'
updated_at = <Date 2010-04-18.19:36:22.907>
user = 'https://bugs.python.org/klankschap'

bugs.python.org fields:

activity = <Date 2010-04-18.19:36:22.907>
actor = 'ronaldoussoren'
assignee = 'ronaldoussoren'
closed = True
closed_date = <Date 2010-04-18.19:36:22.908>
closer = 'ronaldoussoren'
components = ['macOS']
creation = <Date 2010-02-23.15:21:31.070>
creator = 'klankschap'
dependencies = []
files = []
hgrepos = []
issue_num = 8002
keywords = []
message_count = 5.0
messages = ['99925', '99927', '100574', '100579', '103523']
nosy_count = 2.0
nosy_names = ['ronaldoussoren', 'klankschap']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue8002'
versions = ['Python 2.6']

@klankschap
Copy link
Mannequin Author

klankschap mannequin commented Feb 23, 2010

OSX has a different interpretation of the file creation date.
a workaround is possible via libc.dylib stat64 but that in turn is not possible prior to OSX 10.5

@klankschap klankschap mannequin added OS-mac type-feature A feature request or enhancement labels Feb 23, 2010
@ronaldoussoren
Copy link
Contributor

To be more precise: see bpo-8001.

The OSX 10.5 introduces a new version of stat 'stat64' that exposes additional information to posix-style programs, amongst which is the file creation date.

This field is not present in earlier editions of OSX and is also not present on other platforms. That is, the field is not the same as the "ctime" field which contains the timestamp for the last metadata change for a file.

@ronaldoussoren
Copy link
Contributor

I've done some research: the st_birthtime field is available when the python executable is build using MACOSX_DEPLOYMENT_TARGET=10.5 (or later), not for 10.4.

Adding support for st_birthtime for MACOSX_DEPLOYMENT_TARGET=10.4 is possible but requires significant code duplication in posixmodule.c.

IMO it adding this support is not worth the effort or the additional code complexity.

@klankschap
Copy link
Mannequin Author

klankschap mannequin commented Mar 7, 2010

On Mar 7, 2010, at 13:08, Ronald Oussoren wrote:

IMO it adding this support is not worth the effort or the additional code complexity.

I do agree.
We have to look forwards ...

F

@ronaldoussoren
Copy link
Contributor

I'm closing this issue as won't fix.

The additional fields are available if you build from source and target 10.5 or later (set 'MACOSX_DEPLOYMENT_TARGET=10.5' when you run configure).

My current plan is to have two installers for python 2.7 and 3.2: one is a 32-bit only version that runs on OSX 10.3 or later and one will be be a new version that supports 64-bit x86 code as well and requires OSX 10.5. This new installer won't suffer from this issue.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant