Class: VirtFS::NativeFS::Thin::File
- Inherits:
-
Object
- Object
- VirtFS::NativeFS::Thin::File
- Defined in:
- lib/virtfs/nativefs/thin/file.rb
Instance Attribute Summary collapse
-
#block_size ⇒ Object
readonly
Returns the value of attribute block_size.
-
#file_obj ⇒ Object
readonly
Returns the value of attribute file_obj.
-
#fs ⇒ Object
readonly
Returns the value of attribute fs.
Instance Method Summary collapse
- #atime ⇒ Object
- #chmod(permission) ⇒ Object
- #chown(owner, group) ⇒ Object
- #close ⇒ Object
- #close_on_exec=(bool) ⇒ Object
- #close_on_exec? ⇒ Boolean
- #close_read ⇒ Object
- #close_write ⇒ Object
- #ctime ⇒ Object
- #fcntl(cmd, arg) ⇒ Object
- #fdatasync ⇒ Object
- #fileno ⇒ Object
- #flock(locking_constant) ⇒ Object
- #flush ⇒ Object
- #fsync ⇒ Object
-
#initialize(fs, instance_handle, parsed_args) ⇒ File
constructor
A new instance of File.
- #isatty ⇒ Object
- #lstat ⇒ Object
- #mtime ⇒ Object
- #pid ⇒ Object
- #raw_read(start_byte, num_bytes) ⇒ Object
- #raw_write(start_byte, buf) ⇒ Object
- #size ⇒ Object
- #stat ⇒ Object
- #truncate(len) ⇒ Object
Constructor Details
#initialize(fs, instance_handle, parsed_args) ⇒ File
Returns a new instance of File.
6 7 8 9 10 11 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 6 def initialize(fs, instance_handle, parsed_args) @fs = fs @file_obj = instance_handle @parsed_args = parsed_args @block_size = 512 end |
Instance Attribute Details
#block_size ⇒ Object (readonly)
Returns the value of attribute block_size.
4 5 6 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 4 def block_size @block_size end |
#file_obj ⇒ Object (readonly)
Returns the value of attribute file_obj.
4 5 6 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 4 def file_obj @file_obj end |
#fs ⇒ Object (readonly)
Returns the value of attribute fs.
4 5 6 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 4 def fs @fs end |
Instance Method Details
#atime ⇒ Object
13 14 15 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 13 def atime @file_obj.atime end |
#chmod(permission) ⇒ Object
17 18 19 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 17 def chmod() @file_obj.chmod() end |
#chown(owner, group) ⇒ Object
21 22 23 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 21 def chown(owner, group) @file_obj.chown(owner, group) end |
#close ⇒ Object
25 26 27 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 25 def close @file_obj.close unless @file_obj.closed? end |
#close_on_exec=(bool) ⇒ Object
33 34 35 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 33 def close_on_exec=(bool) @file_obj.close_on_exec = bool end |
#close_on_exec? ⇒ Boolean
29 30 31 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 29 def close_on_exec? @file_obj.close_on_exec? end |
#close_read ⇒ Object
37 38 39 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 37 def close_read @file_obj.close_read end |
#close_write ⇒ Object
41 42 43 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 41 def close_write @file_obj.close_write end |
#ctime ⇒ Object
45 46 47 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 45 def ctime @file_obj.ctime end |
#fcntl(cmd, arg) ⇒ Object
49 50 51 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 49 def fcntl(cmd, arg) @file_obj.fcntl(cmd, arg) end |
#fdatasync ⇒ Object
53 54 55 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 53 def fdatasync @file_obj.fdatasync end |
#fileno ⇒ Object
61 62 63 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 61 def fileno @file_obj.fileno end |
#flock(locking_constant) ⇒ Object
65 66 67 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 65 def flock(locking_constant) @file_obj.flock(locking_constant) end |
#flush ⇒ Object
57 58 59 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 57 def flush @file_obj.flush end |
#fsync ⇒ Object
69 70 71 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 69 def fsync @file_obj.fsync end |
#isatty ⇒ Object
73 74 75 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 73 def isatty @file_obj.isatty end |
#lstat ⇒ Object
77 78 79 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 77 def lstat @file_obj.lstat end |
#mtime ⇒ Object
81 82 83 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 81 def mtime @file_obj.mtime end |
#pid ⇒ Object
85 86 87 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 85 def pid @file_obj.pid end |
#raw_read(start_byte, num_bytes) ⇒ Object
89 90 91 92 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 89 def raw_read(start_byte, num_bytes) @file_obj.sysseek(start_byte, IO::SEEK_SET) @file_obj.sysread(num_bytes) end |
#raw_write(start_byte, buf) ⇒ Object
94 95 96 97 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 94 def raw_write(start_byte, buf) @file_obj.sysseek(start_byte, IO::SEEK_SET) @file_obj.syswrite(buf) end |
#size ⇒ Object
99 100 101 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 99 def size @file_obj.size end |
#stat ⇒ Object
103 104 105 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 103 def stat @file_obj.stat end |
#truncate(len) ⇒ Object
107 108 109 |
# File 'lib/virtfs/nativefs/thin/file.rb', line 107 def truncate(len) @file_obj.truncate(len) end |