# File lib/pathname2.rb, line 117
   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')

      # Handle File URL's. The separate methods for Windows are necessary
      # because Ruby's URI class does not (currently) parse absolute file URL's
      # properly when they include a drive letter. 
      if @win
         if PathIsURL(path.dup) # Dup to avoid frozen string issues
            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

      # Convert forward slashes to backslashes on Windows
      path = path.tr("/", @sep) if @win
      super(path)
   end