Class File::Stat
In: lib/win32/file/stat.rb
Parent: Object

Methods

<=>   archive?   atime   blksize   blockdev?   blocks   chardev?   compressed?   content_indexed?   ctime   dev   directory?   encrypted?   executable?   executable_real?   file?   ftype   gid   grpowned?   hidden?   indexed?   ino   inspect   mode   mtime   new   nlink   normal?   offline?   owned?   pipe?   pretty_print   rdev   read_only?   readable?   readable_real?   readonly?   reparse_point?   setgid?   setuid?   size   size?   socket?   sparse?   sticky?   symlink?   system?   temporary?   uid   writable?   writable_real?   zero?  

Included Modules

Windows::MSVCRT::Buffer Windows::MSVCRT::File Windows::DeviceIO Windows::FileSystem Windows::Path Windows::File Windows::Error Windows::Handle Windows::Volume Comparable

Constants

VERSION = '1.2.7'
S_IWGRP = 0020   Defined in Ruby‘s win32.h. Not meant for public consumption.
S_IWOTH = 0002

External Aliases

initialize -> old_init
  This is the only way to avoid a -w warning for initialize. We remove it later, after we‘ve defined our initialize method.

Attributes

dev_major  [R] 
dev_minor  [R] 
rdev_major  [R] 
rdev_minor  [R] 

Public Class methods

Creates and returns a File::Stat object, which encapsulate common status information for File objects on MS Windows sytems. The information is recorded at the moment the File::Stat object is created; changes made to the file after that point will not be reflected.

Public Instance methods

Compares two File::Stat objects. Comparsion is based on mtime only.

Returns whether or not the file is an archive file.

Returns a Time object containing the last access time.

Returns the file system‘s block size, or nil if it cannot be determined.

Returns whether or not the file is a block device. For MS Windows a block device is a removable drive, cdrom or ramdisk.

Returns the number of blocks used by the file, where a block is defined as size divided by blksize, rounded up.

:no-doc: This is a fudge. A search of the internet reveals different ways people have defined st_blocks on MS Windows.

Returns whether or not the file is a character device.

Returns whether or not the file is compressed.

content_indexed?()

Alias for indexed?

Returns a Time object containing the time that the file status associated with the file was changed.

Drive letter (A-Z) of the disk containing the file. If the path is a UNC path then the drive number (probably -1) is returned instead.

Returns whether or not the file is a directory.

Returns whether or not the file in encrypted.

Returns whether or not the file is executable. Generally speaking, this means .bat, .cmd, .com, and .exe files.

executable_real?()

Alias for executable?

Returns whether or not the file is a regular file, as opposed to a pipe, socket, etc.

Identifies the type of file. The return string is one of: file, directory, characterSpecial, socket or unknown.

Group ID. Always 0.

Meaningless on Windows.

Returns whether or not the file is hidden.

Returns whether or not the file is content indexed.

Inode number. Meaningless on NTFS.

Returns a stringified version of a File::Stat object.

Bit mask for file-mode information.

:no-doc: This was taken from rb_win32_stat() in win32.c. I‘m not entirely sure what the point is.

Returns a Time object containing the modification time.

Always 1

Returns whether or not the file is ‘normal’. This is only true if virtually all other attributes are false.

Returns whether or not the file is offline.

Always true on Windows

Returns whether or not the file is a pipe.

A custom pretty print method. This was necessary not only to handle the additional attributes, but to work around an error caused by the builtin method for the current File::Stat class (see pp.rb).

Drive number of the disk containing the file.

read_only?()

Alias for readonly?

Meaningless on Windows

Meaningless on Windows

Returns whether or not the file is readonly.

Returns whether or not the file is a reparse point.

Meaningless on Windows

Meaningless on Windows

Returns the size of the file, in bytes.

Returns nil if statfile is a zero-length file; otherwise, returns the file size. Usable as a condition in tests.

socket?()

Alias for pipe?

Returns whether or not the file is a sparse file. In most cases a sparse file is an image file.

Meaningless on Windows.

Meaningless on Windows at the moment. This may change in the future.

Returns whether or not the file is a system file.

Returns whether or not the file is being used for temporary storage.

User ID. Always 0.

Meaningless on Windows.

Meaningless on Windows.

Returns whether or not the file size is zero.

[Validate]