views:

1061

answers:

2

I can no longer use / at the windows xp command prompt, and it seems to have started after a botched cygwin installation, e.g. cd /windows won't work, but used to.

Can anyone think of how this might have happened?

OOPS! It doesn't normally work in XP, though I had read that it does in Vista. I simplified my problem and it was wrong. The real problem is:

I was using the cwrsync binaries (meant for cygwin use) that can be used at the command prompt in a way such as:

ssh -i /keydir/keyfile user@server

but after doing something (seems like it was installing cygwin), and even after reinstalling the cwrsync files, I can now only do:

ssh -i \keydir\keyfile user@server, i.e. I have to use the windows convention when referring to local files.

I posted this on the cwrsync forum, but it's not very active, so I was hoping someone might recognize what's going on here, I should maybe try the cygwin forum too.

+1  A: 

You imagined it - it never worked.

If you happen to be in C:\ and type

C:\>cd /windows

it will take you to C:\WINDOWS\ but that's only because /windows is not a valid option to cd, so it tries ignoring the /.

Forward slash is a path separator in UNIX and cygwin, but Windows uses it for commandline options, eg. dir /w.

Hugh Allen
A: 

Actually, since DOS 2.0, the kernel and file APIs have always supported forward slash, and many command line calls. See: http://blogs.msdn.com/larryosterman/archive/2005/06/24/432386.aspx.

I used to go to great pains to detect the OS and use a PATH_SEPARATOR type constant in PHP, when I discovered this by accident (it's use is now considered deprecated, in lieu of a simple "/").

Cheers.