Skip to content

os.getCreationTime is incorrect/impossible on Posix systemsΒ #1058

Closed

Description

@Varriount

The value that os.getCreationTime returns on posix systems is derived from stat.st_ctime, which is the time a files attributes were last changed.

On Linux and Mac OSX, stat.st_birthtimespec (or depending on age, just st_birthtime) is available.

Either this should be fixed, a warning should be put in the documentation concerning this, a deprecation notice be put in place, or both.

Activity

  1. dom96 commented on Aug 23, 2015

    @dom96
    Contributor

    Let's fix it.

  2. dom96 commented on Aug 23, 2015

    @dom96
    Contributor

    Are you sure st_birthtimespec is POSIX-compliant? I don't see it in the docs. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

    Just looked it up: http://unix.stackexchange.com/a/91200. There is no kernel API in Linux to access it.

  3. dom96 commented on Aug 23, 2015

    @dom96
    Contributor

    The documentation already contained this information in fact.

  4. sjuxax commented on Mar 30, 2018

    @sjuxax

    FYI, an updated statx call was merged in Linux 4.11, including birth time. See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a528d35e8bfcc521d7cb70aaf03e1bd296c8493f .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions