Method: FileIndexing::IndexAgent.get_correct_mtime
- Defined in:
- lib/file_indexing/index_agent.rb
.get_correct_mtime(file) ⇒ Object
TODO(kolman): Replace this with File.lstat(file).mtime when new version of Ruby comes out. bugs.ruby-lang.org/issues/6385
59 60 61 62 63 64 65 66 |
# File 'lib/file_indexing/index_agent.rb', line 59 def IndexAgent.get_correct_mtime(file) begin File.open(file, 'r') { |f| f.mtime } rescue Errno::EACCES => e Log.warning("Could not open file #{file} to get mtime. #{e}") return 0 end end |