In Files

Parent

FileW

Calls the Unicode (wide) versions of the Windows API’s file functions.

It’s a subclass of the standard File class that only overrides the methods when it’s run on a Windows system. Otherwise it functions as a normal File class. File methods not re-implemented will behave as normal - trying to call the ASCII Windows API.

Public Class Methods

atime(file_name) click to toggle source
  • file_name — UTF-8 String
# File FileW.rb, line 25
        def self.atime(file_name)
                file_name = WinEx::FileSystem::normalize_w(file_name)
                return WinEx::FileSystem.get_file_data(file_name).last_access_time
        end
basename(file_name, suffix = nil) click to toggle source
  • file_name — UTF-8 String
  • suffix — UTF-8 String
# File FileW.rb, line 32
        def self.basename(file_name, suffix = nil)
                # (!) Verify
                basename = file_name.split('/').last
                unless suffix.nil?
                        len = suffix.length
                        basename[-len, len] = '' if basename[-len, len] == suffix
                end
                return basename
        end
catname(from, to) click to toggle source
  • from — UTF-8 String
  • to — UTF-8 String
# File FileW.rb, line 44
        def self.catname(from, to)
                if self.directory?(to)
                        # (!) Normalize file_name
                        return self::join( to.sub(%r([/\\]$), ''), self.basename(from) )
                else
                        return to
                end
        end
ctime(file_name) click to toggle source
  • file_name — UTF-8 String
# File FileW.rb, line 54
        def self.ctime(file_name)
                file_name = WinEx::FileSystem::normalize_w(file_name)
                return WinEx::FileSystem.get_file_data(file_name).creation_time
        end
join(*args) click to toggle source

(Not documented)

# File FileW.rb, line 59
        def self.join(*args)
                # http://www.ruby-forum.com/topic/50137
                return args.join(self::SEPARATOR)
        end
mtime(file_name) click to toggle source
  • file_name — UTF-8 String
# File FileW.rb, line 65
        def self.mtime(file_name)
                file_name = WinEx::FileSystem::normalize_w(file_name)
                return WinEx::FileSystem.get_file_data(file_name).last_write_time
        end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.