Class: SlowFat::FatFile
- Inherits:
-
Object
- Object
- SlowFat::FatFile
- Defined in:
- lib/slowfat/fat_file.rb
Overview
FatFile represents a single file on a FAT filesystem
Instance Method Summary collapse
-
#contents ⇒ String
Return the entire contents of a file.
-
#initialize(filesystem:, dentry:) ⇒ FatFile
constructor
Initialize a new Directory object (normally only called from Directory’s functions).
Constructor Details
#initialize(filesystem:, dentry:) ⇒ FatFile
Initialize a new Directory object (normally only called from Directory’s functions)
9 10 11 12 13 |
# File 'lib/slowfat/fat_file.rb', line 9 def initialize(filesystem:, dentry:) @filesystem = filesystem @dentry = dentry @data = Data.new(backing: filesystem.backing, base: filesystem.data_base, cluster_size: filesystem.cluster_size) end |
Instance Method Details
#contents ⇒ String
Return the entire contents of a file
18 19 20 |
# File 'lib/slowfat/fat_file.rb', line 18 def contents @data.cluster_chain_contents chain: @filesystem.fats[0].chain_starting_at(@dentry.start_cluster), size: @dentry.size end |