Skip to content

reynhout/ruby-file-birthtime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This module extends core Ruby classes File and File::Stat with methods to query file birthtime (creation time).

For now, only systems with field st_birthtime in struct stat (BSDs with UFS2 support).

  • ruby >= 1.9

  • rubygem >= 1.2

  • working C compiler

If installing to $HOME

export RB_USER_INSTALL=true
git clone git://github.com/mwisnicki/ruby-file-birthtime.git
cd ruby-file-birthtime
gem build ruby-file-birthtime.gemspec
gem install file-birthtime-*.gem
require 'file_btime' # => true
File.btime('.') # => Tue Jun 16 15:07:21 0200 2009
File.new('.').btime # => Tue Jun 16 15:07:21 0200 2009
File.stat('.').btime # => Tue Jun 16 15:07:21 0200 2009

Returns nil if particular filesystem does not support birthtimes (st_birthtime<0).

  1. Add necessary checks to extconf.rb

  2. Port to other platforms - at least Win32, MacOSX, maybe Solaris (with ZFS).

About

Birthtime support for File and File::Stat

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 51.7%
  • Ruby 48.3%