Class: TorqueBox::VFS::File::Stat
- Inherits:
-
Object
- Object
- TorqueBox::VFS::File::Stat
- Defined in:
- lib/torquebox/vfs/file.rb
Instance Method Summary collapse
- #atime ⇒ Object
- #blksize ⇒ Object
- #blockdev? ⇒ Boolean
- #blocks ⇒ Object
- #chardev? ⇒ Boolean
- #cmp(other) ⇒ Object
- #ctime ⇒ Object
- #dev ⇒ Object
- #dev_major ⇒ Object
- #dev_minor ⇒ Object
- #directory? ⇒ Boolean
- #executable? ⇒ Boolean
- #executable_real? ⇒ Boolean
- #file? ⇒ Boolean
- #ftype ⇒ Object
- #gid ⇒ Object
- #grpowned? ⇒ Boolean
-
#initialize(virtual_file) ⇒ Stat
constructor
A new instance of Stat.
- #ino ⇒ Object
- #mode ⇒ Object
- #mtime ⇒ Object
- #nlink ⇒ Object
- #owned? ⇒ Boolean
- #pipe? ⇒ Boolean
- #rdev ⇒ Object
- #rdev_major ⇒ Object
- #rdev_minor ⇒ Object
- #readable? ⇒ Boolean
- #readable_real? ⇒ Boolean
- #setgid? ⇒ Boolean
- #setuid? ⇒ Boolean
- #size ⇒ Object
- #socket? ⇒ Boolean
- #sticky? ⇒ Boolean
- #symlink? ⇒ Boolean
- #uid ⇒ Object
- #writable? ⇒ Boolean
- #writable_real? ⇒ Boolean
- #zero? ⇒ Boolean
Constructor Details
#initialize(virtual_file) ⇒ Stat
Returns a new instance of Stat.
22 23 24 |
# File 'lib/torquebox/vfs/file.rb', line 22 def initialize(virtual_file) @virtual_file = virtual_file end |
Instance Method Details
#atime ⇒ Object
30 31 32 |
# File 'lib/torquebox/vfs/file.rb', line 30 def atime() Time.at( @virtual_file.last_modified ) end |
#blksize ⇒ Object
34 35 36 |
# File 'lib/torquebox/vfs/file.rb', line 34 def blksize nil end |
#blockdev? ⇒ Boolean
38 39 40 |
# File 'lib/torquebox/vfs/file.rb', line 38 def blockdev? false end |
#blocks ⇒ Object
42 43 44 |
# File 'lib/torquebox/vfs/file.rb', line 42 def blocks nil end |
#chardev? ⇒ Boolean
46 47 48 |
# File 'lib/torquebox/vfs/file.rb', line 46 def chardev? true end |
#cmp(other) ⇒ Object
26 27 28 |
# File 'lib/torquebox/vfs/file.rb', line 26 def cmp(other) @virtual_file.last_modified <=> other.last_modified end |
#ctime ⇒ Object
50 51 52 |
# File 'lib/torquebox/vfs/file.rb', line 50 def ctime Time.at( @virtual_file.last_modified ) end |
#dev ⇒ Object
54 55 56 |
# File 'lib/torquebox/vfs/file.rb', line 54 def dev nil end |
#dev_major ⇒ Object
58 59 60 |
# File 'lib/torquebox/vfs/file.rb', line 58 def dev_major nil end |
#dev_minor ⇒ Object
62 63 64 |
# File 'lib/torquebox/vfs/file.rb', line 62 def dev_minor nil end |
#directory? ⇒ Boolean
66 67 68 |
# File 'lib/torquebox/vfs/file.rb', line 66 def directory? @virtual_file.exists && ! @virtual_file.is_leaf end |
#executable? ⇒ Boolean
70 71 72 |
# File 'lib/torquebox/vfs/file.rb', line 70 def executable? false end |
#executable_real? ⇒ Boolean
74 75 76 |
# File 'lib/torquebox/vfs/file.rb', line 74 def executable_real? false end |
#file? ⇒ Boolean
78 79 80 |
# File 'lib/torquebox/vfs/file.rb', line 78 def file? true end |
#ftype ⇒ Object
82 83 84 85 |
# File 'lib/torquebox/vfs/file.rb', line 82 def ftype return 'file' if @virtual_file.is_leaf 'directory' end |
#gid ⇒ Object
87 88 89 |
# File 'lib/torquebox/vfs/file.rb', line 87 def gid nil end |
#grpowned? ⇒ Boolean
91 92 93 |
# File 'lib/torquebox/vfs/file.rb', line 91 def grpowned? false end |
#ino ⇒ Object
95 96 97 |
# File 'lib/torquebox/vfs/file.rb', line 95 def ino nil end |
#mode ⇒ Object
99 100 101 |
# File 'lib/torquebox/vfs/file.rb', line 99 def mode 0x444 end |
#mtime ⇒ Object
103 104 105 |
# File 'lib/torquebox/vfs/file.rb', line 103 def mtime Time.at( @virtual_file.getLastModified() / 1000 ) end |
#nlink ⇒ Object
107 108 109 |
# File 'lib/torquebox/vfs/file.rb', line 107 def nlink 1 end |
#owned? ⇒ Boolean
111 112 113 |
# File 'lib/torquebox/vfs/file.rb', line 111 def owned? false end |
#pipe? ⇒ Boolean
115 116 117 |
# File 'lib/torquebox/vfs/file.rb', line 115 def pipe? false end |
#rdev ⇒ Object
119 120 121 |
# File 'lib/torquebox/vfs/file.rb', line 119 def rdev nil end |
#rdev_major ⇒ Object
123 124 125 |
# File 'lib/torquebox/vfs/file.rb', line 123 def rdev_major nil end |
#rdev_minor ⇒ Object
127 128 129 |
# File 'lib/torquebox/vfs/file.rb', line 127 def rdev_minor nil end |
#readable? ⇒ Boolean
131 132 133 |
# File 'lib/torquebox/vfs/file.rb', line 131 def readable? true end |
#readable_real? ⇒ Boolean
135 136 137 |
# File 'lib/torquebox/vfs/file.rb', line 135 def readable_real? true end |
#setgid? ⇒ Boolean
139 140 141 |
# File 'lib/torquebox/vfs/file.rb', line 139 def setgid? false end |
#setuid? ⇒ Boolean
143 144 145 |
# File 'lib/torquebox/vfs/file.rb', line 143 def setuid? false end |
#size ⇒ Object
147 148 149 |
# File 'lib/torquebox/vfs/file.rb', line 147 def size @virtual_file.size end |
#socket? ⇒ Boolean
151 152 153 |
# File 'lib/torquebox/vfs/file.rb', line 151 def socket? false end |
#sticky? ⇒ Boolean
155 156 157 |
# File 'lib/torquebox/vfs/file.rb', line 155 def sticky? false end |
#symlink? ⇒ Boolean
159 160 161 |
# File 'lib/torquebox/vfs/file.rb', line 159 def symlink? false end |
#uid ⇒ Object
163 164 165 |
# File 'lib/torquebox/vfs/file.rb', line 163 def uid nil end |
#writable? ⇒ Boolean
167 168 169 170 171 172 173 174 |
# File 'lib/torquebox/vfs/file.rb', line 167 def writable? begin physical_file = @virtual_file.physical_file physical_file.canWrite rescue => e false end end |
#writable_real? ⇒ Boolean
176 177 178 |
# File 'lib/torquebox/vfs/file.rb', line 176 def writable_real? writable? end |
#zero? ⇒ Boolean
180 181 182 |
# File 'lib/torquebox/vfs/file.rb', line 180 def zero? self.size == 0 end |