Path separator

John A Meinel john at arbash-meinel.com
Sat Oct 29 01:17:47 BST 2005


Wouter van Heyst wrote:
> On Fri, Oct 28, 2005 at 05:25:54PM -0500, John A Meinel wrote:
>> I'm trying to go through the code and do some cleanup stuff for windows.
>> One of the things I'm trying to do is update the path code so that it
>> always uses forward slashes internally.
>> Part of this is Robert's desire that all paths internally are considered
>> url encoded.
>> The issue is that when you finally get down to printing a path, the only
>> paths that should be switched to '\' are local paths.
>> Because you don't want to change remote paths
>> (http:\\bazaar-ng.org\bzr\bzr.dev)
> 
> Reminds me of a problem in the 0.0.5 era with urlgrabber calling abspath
> on urls, ugh.
> 
>> I understand the "dir" doesn't handle forward slashes properly, because
>> it uses them as options. And probably a couple of other windows console
>> programs. (Though I know "cd another/path" works, though cd c:/ acts
>> like cd c: not cd c:\)
> 
> cd c:/something/orother will reportedly not work at all, though cd
> c:\something/orother does.

No, cd c:/something/orother does indeed work.
cd c:/ switches the directory to "C:" as though you typed cd c:
Versus cd c:\ which will take you to the root directory.

The problem is more that "dir c:/something/or/other" starts looking for
the option "/something" (or maybe just /s).

> 
>> I would like to re-iterate that Windows people who are comfortable with
>> the shell, are probably comfortable enough to handle the forward versus
>> backslash issues, and having a consistent interface between platforms
>> makes things easier.
>>
>> I'm just thinking that if you start asking for a remote file, you need
>> to make sure that you are using forward slashes, but local files need
>> back slashes seems bad form.
> 
> I'm not fond of them, but I'm afraid always using slashes will break.

In all of my testing, as long as you are internal to a program, forward
slashes work fine. (In fact, there are a few Qt programs whose file
dialog presents everything with a forward slash).

Windows does very little shell interpretation (for example "foo *.c"
does not expand the *, it expects the program to do so)
It is generally just up to the individual programs to decide how they
handle arguments.

John
=:->

> 
> Wouter van Heyst
> 
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051028/3ecc84f6/attachment.pgp 


More information about the bazaar mailing list