Re: UNC paths, glib, and the file chooser



Federico Mena Quintero wrote:

Hi,

Sven just filed this bug for Glib:
http://bugzilla.gnome.org/show_bug.cgi?id=166577

And there's a related thing for the Unix backend of the file chooser:
http://bugzilla.gnome.org/show_bug.cgi?id=135877

The Glib bug is about not doing the right conversion.  The file chooser
bug is about canonicalizing filenames, which is not really Glib's job,
but we may be able to use the same code for both parts of both tasks.

Does anyone know the One True Way(tm) to UNC paths?  I have no idea of
how they are supposed to work, either on Unix or in Windows.
Internet Explorer canonicalises UNC paths to URIs as file://hostname/share/path, while mozilla canonicalises to file://///hostname/share/path.

While the IE path is a bit shorter, the five-slash version probably follows the specs better:

   * there is no spec for accessing file: URIs with a hostpart which
     isn't "localhost" or empty.
   * UNC paths look like parts of the file-system as far as normal file
     IO operations go (just as NFS mounts do under unix).
   * If you are going to use a host part in the URI, the scheme should
     probably be smb ...

The five-slash canonicalisation is really just applying the normal DOS path -> URI canonicalisation of file:///[dos path, converting '\' to '/' and ':' to '|']. From reading the code, it looks like g_filename_from_uri() handles that fine, and g_filename_to_uri() will return a five-slash URI.

However, file://hostname/share/path URIs do exist on Windows, so g_filename_from_uri() should probably return a UNC path on Windows if a host part exists in the URI.

James.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]