def initialize(path)
if path.length > MAXPATH
msg = "string too long. maximum string length is " + MAXPATH.to_s
raise Error, msg
end
@sep = File::ALT_SEPARATOR || File::SEPARATOR
@win = Config::CONFIG['host_os'].match('mswin')
if @win
if PathIsURL(path.dup)
buf = 0.chr * MAXPATH
len = [buf.length].pack("l")
if PathCreateFromUrl(path, buf, len, 0) == S_OK
path = buf.strip
else
raise Error, "invalid file url: #{path}"
end
end
else
if path.index('file:///', 0)
require 'uri'
path = URI.decode(URI.parse(path).path)
end
end
path = path.tr("/", @sep) if @win
super(path)
end