Description

Extra or redefined methods for the File class on MS Windows.

Prerequisites

  • Ruby 1.8.0 or later

  • windows-pr 0.3.0 or later

  • win32-file-stat 1.2.0 or later

Installation

Gem installation

gem install win32-file

Local installation

rake install

Synopsis

require 'win32/file'
p File.hidden?(somefile)
p File.attributes(somefile)
File.open(somefile){ |fh|
   fh.hidden = true
}

Class methods added - see documentation for details

  • File.attributes

  • File.archive?

  • File.compressed?

  • File.decrypt

  • File.encrypt

  • File.encrypted?

  • File.get_permissions

  • File.hidden?

  • File.indexed?

  • File.longpath

  • File.normal?

  • File.offline?

  • File.readonly?

  • File.remove_attributes

  • File.reparse_point?

  • File.securities

  • File.set_attributes

  • File.set_permissions

  • File.shortpath

  • File.sparse?

  • File.system?

  • File.temporary?

Instance methods added - see documentation for details

  • File#archive=

  • File#compressed=

  • File#hidden=

  • File#indexed=

  • File#normal=

  • File#offline=

  • File#readonly=

  • File#sparse=

  • File#system=

  • File#temporary=

Class methods redefined and the reason for redefining them

  • File.basename # UNC path issues

  • File.blksize # Wasn’t implemented

  • File.blockdev? # Wasn’t implemented

  • File.chardev? # Wasn’t implemented

  • File.dirname # UNC path issues

  • File.size # 2GB limitation

  • File.split # UNC path issues

Known issues or bugs

None that I’m aware of. Please report any bugs you find on the project page at www.rubyforge.org/projects/win32utils.

License

Artistic 2.0

© 2003-2009, Daniel J. Berger, All Rights Reserved

Warranty

This package is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.

Authors

  • Daniel J. Berger

  • Park Heesob