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.
192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/fakefs/file.rb', line 192 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.
190 191 192 |
# File 'lib/fakefs/file.rb', line 190 def ctime @ctime end |
#mtime ⇒ Object (readonly)
Returns the value of attribute mtime.
190 191 192 |
# File 'lib/fakefs/file.rb', line 190 def mtime @mtime end |
Instance Method Details
#directory? ⇒ Boolean
208 209 210 |
# File 'lib/fakefs/file.rb', line 208 def directory? File.directory?(@file) end |
#nlink ⇒ Object
212 213 214 |
# File 'lib/fakefs/file.rb', line 212 def nlink @fake_file.links.size end |