Skip to content

Get creation time of files for any platform - no external dependencies ⏰

Notifications You must be signed in to change notification settings

kootenpv/crtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crtime

PyPI PyPI

Get creation time of files for any platform and no external dependencies.

Caveat

Linux requires sudo! There is no way to avoid this, as creation time is not exposed by the kernel.

It uses debugfs to mount the filesystem, as the information is actually contained on most linux platforms.

Speed: because it does one query for a whole directory, it is roughly 1000x faster than any other method (such as the xstat utility that can be found online).

Installation

pip install crtime

Usage

In a shell:

crtime .
# 1552938709\tfile_a.py

In Python

from crtime import get_crtimes_in_dir

for fname, date in get_crtimes_in_dir(".", raise_on_error=True, as_epoch=False):
    print(fname, date)
# file_a.py Mon Mar 18 20:51:18 CET 2019

About

Get creation time of files for any platform - no external dependencies ⏰

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages