Class: MiqFile

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/MiqFS/MiqFS.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fs, fobj) ⇒ MiqFile

Returns a new instance of MiqFile.



478
479
480
481
# File 'lib/fs/MiqFS/MiqFS.rb', line 478

def initialize(fs, fobj)
  @fs = fs
  @fobj = fobj
end

Instance Attribute Details

#fobjObject

Returns the value of attribute fobj.



476
477
478
# File 'lib/fs/MiqFS/MiqFS.rb', line 476

def fobj
  @fobj
end

#fsObject

Returns the value of attribute fs.



476
477
478
# File 'lib/fs/MiqFS/MiqFS.rb', line 476

def fs
  @fs
end

Instance Method Details

#atimeObject



504
505
506
# File 'lib/fs/MiqFS/MiqFS.rb', line 504

def atime
  @fs.fileAtime_obj(@fobj)
end

#closeObject



496
497
498
# File 'lib/fs/MiqFS/MiqFS.rb', line 496

def close
  @fs.fs_fileClose(@fobj)
end

#ctimeObject



508
509
510
# File 'lib/fs/MiqFS/MiqFS.rb', line 508

def ctime
  @fs.fileCtime_obj(@fobj)
end

#mtimeObject



512
513
514
# File 'lib/fs/MiqFS/MiqFS.rb', line 512

def mtime
  @fs.fileMtime_obj(@fobj)
end

#read(len = -1)) ⇒ Object



487
488
489
490
# File 'lib/fs/MiqFS/MiqFS.rb', line 487

def read(len = -1)
  return(@fs.fs_fileRead(@fobj, len)) if len >= 0
  (@fs.fs_fileRead(@fobj, size))
end

#seek(amt, whence = IO::SEEK_SET) ⇒ Object



483
484
485
# File 'lib/fs/MiqFS/MiqFS.rb', line 483

def seek(amt, whence = IO::SEEK_SET)
  @fs.fs_fileSeek(@fobj, amt, whence)
end

#sizeObject



500
501
502
# File 'lib/fs/MiqFS/MiqFS.rb', line 500

def size
  @fs.fs_fileSize_obj(@fobj)
end

#write(buf, len = buf.length) ⇒ Object



492
493
494
# File 'lib/fs/MiqFS/MiqFS.rb', line 492

def write(buf, len = buf.length)
  return(@fs.fs_fileWrite(@fobj, buf, len)) if len >= 0
end