Class: Ole::Storage::FileClass::Stat

### Home Classes Methods

### In Files

- lib/ole/storage/file_system.rb

### Parent

Object

### Methods

- ::new
- #directory?
- #file?
- #inspect
- #size?

### Files

- ChangeLog
- README

### Class/Module Index

Quicksearch

- Ole
- Ole::IOMode
- Ole::IOMode::Constants
- Ole::Storage
- Ole::Storage::AllocationTable
- Ole::Storage::AllocationTable::Big
- Ole::Storage::AllocationTable::Small
- Ole::Storage::DirClass
- Ole::Storage::DirClass::Dir
- Ole::Storage::Dirent
- Ole::Storage::FileClass
- Ole::Storage::FileClass::Stat
- Ole::Storage::Header
- Ole::Storage::MetaData
- Ole::Storage::RangesIOMigrateable
- Ole::Storage::RangesIOResizeable
- Ole::Types
- Ole::Types::Clsid
- Ole::Types::Data
- Ole::Types::FileTime
- Ole::Types::Lpstr
- Ole::Types::Lpwstr
- Ole::Types::PropertySet
- Ole::Types::PropertySet::Constants
- Ole::Types::PropertySet::Section
- Ole::Types::Variant
- Ole::Types::Variant::Constants
- RangesIO

No matching classes.

# Ole::Storage::FileClass::Stat

### Attributes

blksize[R]
blocks[R]
dev[R]
ftype[R]
gid[R]
ino[R]
nlink[R]
rdev[R]
rdev_major[R]
rdev_minor[R]
size[R]
uid[R]

### Public Class Methods

new(dirent) click to toggle source

    # File lib/ole/storage/file_system.rb, line 61
    def initialize dirent
      @dirent = dirent
      @size = dirent.size
      if file?
        @ftype = 'file'
        bat = dirent.ole.bat_for_size(dirent.size)
        @blocks = bat.chain(dirent.first_block).length
        @blksize = bat.block_size
      else
        @ftype = 'directory'
        @blocks = 0
        @blksize = 0
      end
      # a lot of these are bogus. ole file format has no analogs
      @nlink = 1
      @uid, @gid = 0, 0
      @dev, @rdev = 0, 0
      @ino = 0
      # need to add times - atime, mtime, ctime.
    end

### Public Instance Methods

directory?() click to toggle source

    # File lib/ole/storage/file_system.rb, line 89
    def directory?
      @dirent.dir?
    end

file?() click to toggle source

    # File lib/ole/storage/file_system.rb, line 85
    def file?
      @dirent.file?
    end

inspect() click to toggle source

    # File lib/ole/storage/file_system.rb, line 97
    def inspect
      pairs = (instance_variables - ['@dirent']).map do |n|
        "#{n[1..-1]}=#{instance_variable_get n}"
      end
      "#<#{self.class} #{pairs * ', '}>"
    end

size?() click to toggle source

    # File lib/ole/storage/file_system.rb, line 93
    def size?
      size if file?
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.