Class: FakeFS::File::Stat
- Inherits:
-
Object
- Object
- FakeFS::File::Stat
- Defined in:
- lib/fakefs/file.rb
Instance Attribute Summary collapse
-
#ctime ⇒ Object
readonly
Returns the value of attribute ctime.
-
#mtime ⇒ Object
readonly
Returns the value of attribute mtime.
Instance Method Summary collapse
- #directory? ⇒ Boolean
-
#initialize(file, __lstat = false) ⇒ Stat
constructor
A new instance of Stat.
- #nlink ⇒ Object
- #size ⇒ Object
- #symlink? ⇒ Boolean
Constructor Details
#initialize(file, __lstat = false) ⇒ Stat
Returns a new instance of Stat.
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/fakefs/file.rb', line 221 def initialize(file, __lstat = false) if !File.exists?(file) raise(Errno::ENOENT, "No such file or directory - #{file}") end @file = file @fake_file = FileSystem.find(@file) @__lstat = __lstat @ctime = @fake_file.ctime @mtime = @fake_file.mtime end |
Instance Attribute Details
#ctime ⇒ Object (readonly)
Returns the value of attribute ctime.
219 220 221 |
# File 'lib/fakefs/file.rb', line 219 def ctime @ctime end |
#mtime ⇒ Object (readonly)
Returns the value of attribute mtime.
219 220 221 |
# File 'lib/fakefs/file.rb', line 219 def mtime @mtime end |
Instance Method Details
#directory? ⇒ Boolean
237 238 239 |
# File 'lib/fakefs/file.rb', line 237 def directory? File.directory?(@file) end |
#nlink ⇒ Object
241 242 243 |
# File 'lib/fakefs/file.rb', line 241 def nlink @fake_file.links.size end |