Sha256: 31fbcf37256deb016ed66453c8831120962a5af00db456b2a25104cb4b470df0

Contents?: true

Size: 1.11 KB

Versions: 10

Compression:

Stored size: 1.11 KB

Contents

module RealFS
  attr_reader :guestOS

  def fs_init
    case Sys::Platform::IMPL
    when :mswin, :mingw
      self.fsType = "NTFS"
      @guestOS = "Windows"
    when :linux
      self.fsType = `df -lT / | tail -1 | awk '{ print $2 }'`
      @guestOS = "Linux"
    when :macosx
    end
  end

  def fs_dirEntries(p)
    Dir.entries(p)
  end

  def fs_fileExists?(p)
    File.exist?(p)
  end

  def fs_fileFile?(p)
    File.file?(p)
  end

  def fs_fileDirectory?(p)
    File.directory?(p)
  end

  def fs_fileSize(p)
    File.size(p)
  end

  def fs_fileSize_obj(fobj)
    fobj.stat.size
  end

  def fs_fileAtime(p)
    File.atime(p)
  end

  def fs_fileCtime(p)
    File.ctime(p)
  end

  def fs_fileMtime(p)
    File.mtime(p)
  end

  def fs_fileAtime_obj(fobj)
    fobj.atime
  end

  def fs_fileCtime_obj(fobj)
    fobj.ctime
  end

  def fs_fileMtime_obj(fobj)
    fobj.mtime
  end

  def fs_fileOpen(p, mode = "r")
    File.new(p, mode)
  end

  def fs_fileSeek(fobj, offset, whence)
    fobj.seek(offset, whence)
  end

  def fs_fileRead(fobj, len)
    fobj.read(len)
  end

  def fs_fileClose(fobj)
    fobj.close
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
manageiq-smartstate-0.2.2 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.2.1 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.2.0 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.1.6 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.1.5 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.1.4 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.1.3 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.1.2 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.1.1 lib/fs/MiqFS/modules/RealFS.rb
manageiq-smartstate-0.1.0 lib/fs/MiqFS/modules/RealFS.rb