Method: Backup::FileItem::Base#stat
- Defined in:
- lib/backup/file_item/base.rb
#stat(file) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/backup/file_item/base.rb', line 12 def stat(file) files = {} stat = File.new(file).stat files[file] = { :uid => stat.uid, :gid => stat.gid, :mode => stat.mode } unless File.directory? file files[file][:checksum] = Digest::MD5.hexdigest File.open(file, 'rb').read end files rescue Exception => e STDERR.puts e end |