Path: | README |
Last Update: | Fri Dec 14 11:49:37 -0300 2007 |
A redefinition of the File::Stat class for MS Windows.
rake install (non-gem) OR rake install_gem (gems)
# Don't 'require' like this in practice - see 'Known Issues' below require 'win32/file/stat' stat = File::Stat.new('file.txt') stat.size stat.readonly? stat.hidden?
You should not require ‘win32/file/stat’ directly. Instead, require the win32-file package which will, in turn, require win32-file-stat. This is the preferred approach because some modules (i.e. ‘find’) use the pass-through methods of the File class, such as File.lstat. Many of the pass through methods have been redefined in the win32-file package to work in conjunction with the custom File::Stat objects created by this package.
Failure to follow these instructions could lead to cases where the core Ruby File class attempts to use the custom File::Stat object defined in this class, which will likely cause problems.
None that I‘m aware of. Please report any bugs you find on the project page at www.rubyforge.org/projects/win32utils.
I had to require ‘pp’ explicitly in order to deal with the fact that pp.rb has a builtin pretty_print method for File::Stat. If I didn‘t do this you would end up using the pretty_print in pp.rb, which would break.
Ruby‘s
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.
Daniel J. Berger