A few thoughts about KUrl

subbukk subbukk at gmail.com
Fri Dec 22 09:47:03 GMT 2006


On Thursday 21 December 2006 22:54, Jarosław Staniek wrote:
> The term "current" is tricky and may cause random results.
Not really. In UNIX, "current directory" refers to a single path. On 
Windows, "current" may mean "current device" or "current path within this 
device". Each device has a current path associated with it and there are 
separate commands to set current device and current path. So the command:
   cd c:/foo/bar
to set the current path doesnt affect current device. Should "cd" also 
change the current device to c:? Windows Explorer does the latter too, 
but the "command" shell only changes the current path on device c:. To 
change device, you have to type the command:
  c:
> ..simple calls like cd("/") can return any local or network drive.
> I encountered hard to hunt bugs related to this...
On windows, "cd /" changes to top-most directory in the *current* device 
which defaults to boot drive on startup. In most cases, this is "c:". An 
absolute pathname on Windows should also include the device prefix.

"file:///" parses to "file" protocol, "://" protocol suffix token, "/" 
pathname prefix token and an empty pathname. Interpretation of an empty 
pathname is left to the protocol handler. Windows Explorer on Win9x 
throws up an error. Others could treat it as "My Computer" or as "/". On 
Unix, a safe fallback is to treat it as "/" instead of $CWD.

The URL for absolute root is "file:////" in Unix 
and "file:///<bootdevice>:/" in Windows. Here the '/' characters plays 
three roles - protocol suffix token member, pathname prefix token and as 
a pathname element.

Happy Holidays .. K. K. Subbu




More information about the kde-core-devel mailing list