Class: Ext4::FileObject
- Inherits:
-
Object
- Object
- Ext4::FileObject
- Includes:
- Ext4
- Defined in:
- lib/fs/MiqFS/modules/Ext4.rb
Overview
Top level file object.
Constant Summary
Constants included from Ext4
DEFAULT_BLOCK_SIZE, DEF_CACHE_SIZE, DIR_ENTRY_NEW, DIR_ENTRY_ORIGINAL, EXTENT, EXTENT_HEADER, EXTENT_INDEX, EX_ATTRIB_HEADER, EX_ATTRIB_NAME, GDE, GDE_SIZE, HASH_TREE_ENTRY_FIRST, HASH_TREE_ENTRY_NEXT, HASH_TREE_HEADER, INODE, INODE_SIZE, MAX_READ, POSIX_ACL_ENTRY, POSIX_ACL_HEADER, SIZEOF_DIR_ENTRY_NEW, SIZEOF_DIR_ENTRY_ORIGINAL, SIZEOF_EXTENT, SIZEOF_EXTENT_HEADER, SIZEOF_EXTENT_INDEX, SIZEOF_HASH_TREE_ENTRY, SIZEOF_HASH_TREE_ENTRY_FIRST, SIZEOF_HASH_TREE_ENTRY_NEXT, SIZEOF_HASH_TREE_HEADER, SIZEOF_INODE, SUPERBLOCK, SUPERBLOCK_OFFSET, SUPERBLOCK_SIG, SUPERBLOCK_SIZE, SYM_LNK_SIZE
Instance Attribute Summary collapse
-
#de ⇒ Object
readonly
Returns the value of attribute de.
-
#inode ⇒ Object
readonly
Returns the value of attribute inode.
-
#miqfs ⇒ Object
readonly
Returns the value of attribute miqfs.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes included from Ext4
#cache_hits, #dir_cache, #entry_cache, #rootDir, #superblock
Instance Method Summary collapse
-
#initialize(path, miqfs) ⇒ FileObject
constructor
fs_fileOpen passes ‘self’ into ..
- #open(mode = "r") ⇒ Object
Methods included from Ext4
#fs_dirEntries, #fs_dirMkdir, #fs_dirRmdir, #fs_fileAtime, #fs_fileAtime_obj, #fs_fileClose, #fs_fileCtime, #fs_fileCtime_obj, #fs_fileDelete, #fs_fileDirectory?, #fs_fileExists?, #fs_fileFile?, #fs_fileMtime, #fs_fileMtime_obj, #fs_fileOpen, #fs_fileRead, #fs_fileSeek, #fs_fileSize, #fs_fileSize_obj, #fs_fileWrite, #fs_freeBytes, #fs_init, #fs_isSymLink?, #ifs_getDir, #ifs_getDirR, #ifs_getFile, #ifs_putFile, #unnormalizePath
Constructor Details
#initialize(path, miqfs) ⇒ FileObject
fs_fileOpen passes ‘self’ into .. er, ‘this’.
25 26 27 28 |
# File 'lib/fs/MiqFS/modules/Ext4.rb', line 25 def initialize(path, miqfs) @path = path @miqfs = miqfs end |
Instance Attribute Details
#de ⇒ Object (readonly)
Returns the value of attribute de.
21 22 23 |
# File 'lib/fs/MiqFS/modules/Ext4.rb', line 21 def de @de end |
#inode ⇒ Object (readonly)
Returns the value of attribute inode.
21 22 23 |
# File 'lib/fs/MiqFS/modules/Ext4.rb', line 21 def inode @inode end |
#miqfs ⇒ Object (readonly)
Returns the value of attribute miqfs.
21 22 23 |
# File 'lib/fs/MiqFS/modules/Ext4.rb', line 21 def miqfs @miqfs end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
21 22 23 |
# File 'lib/fs/MiqFS/modules/Ext4.rb', line 21 def path @path end |
Instance Method Details
#open(mode = "r") ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/fs/MiqFS/modules/Ext4.rb', line 30 def open(mode = "r") # Ext4 module methods use miqfs instance accessors to touch @boot_sector. @mode = mode.downcase @de = ifs_getFile(@path, @miqfs) raise "File is directory: '#{@path}'" if @de && @de.isDir? if mode.include?("r") raise "File not found: '#{@path}'" if @de.nil? @inode = @miqfs.superblock.getInode(@de.inode) end end |