Calls the Unicode (wide) versions of the Windows API’s file functions.
It’s a subclass of the standard FileTest class that only overrides the methods when it’s run on a Windows system. Otherwise it functions as a normal FileTest class. File methods not re-implemented will behave as normal - trying to call the ASCII Windows API.
# File FileTestW.rb, line 46 def directory?(file_name) file_name = WinEx::FileSystem::normalize_w(file_name) file_data = WinEx::FileSystem.get_file_data(file_name) return (file_data.file_attributes & WinEx::FILE_ATTRIBUTE_DIRECTORY == WinEx::FILE_ATTRIBUTE_DIRECTORY) # (!) Verify end
# File FileTestW.rb, line 54 def exist?(file_name) file_name = WinEx::FileSystem::normalize_w(file_name) return !WinEx::FileSystem.get_file_data(file_name).nil? end
# File FileTestW.rb, line 61 def size(file_name) # (?) Raise error if file not found? file_name = WinEx::FileSystem::normalize_w(file_name) return WinEx::FileSystem.get_file_data(file_name).file_size end
# File FileTestW.rb, line 68 def size?(file_name) file_name = WinEx::FileSystem::normalize_w(file_name) attribs = WinEx::FileSystem.get_file_data(file_name) return nil if attribs.nil? return nil if attribs.file_size == 0 return attribs.file_size end
# File FileTestW.rb, line 77 def zero?(file_name) file_name = WinEx::FileSystem::normalize_w(file_name) attribs = WinEx::FileSystem.get_file_data(file_name) return false if attribs.nil? return true if attribs.file_size == 0 return false end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.