Update: not quite right...
Another Update:C:\PROJECTS\xyz2009>cd c:/projects The system cannot find the path specified. C:\PROJECTS\xyz009>cd c:\projects C:\PROJECTS>
1. First there are a whole lot of Windows things between Win 3.1 and Win XP: Win 98, WinNT, Win2K. I was thinking more about NT and 2K when I made the comment about previous versions of windows. At one time I had all 4 versions (98,NT,2K,XP) on my network for testing, but am down to just XP now. There are lots of quirks between these various versions.
2. I did some testing at the command prompt on XP and found:
That was a "WOW" moment as I hadn't expected that forward slash to work with the cd command! But it did!C:\> C:\>cd projects/replyto C:\PROJECTS\replyto>
3. Then I found out that there is something special about the Drive: root- the forward slash doesn't work in this situation:
That little discovery is what prompted the update: "not quite right" comment.C:\PROJECTS\replyto>cd c:/projects The system cannot find the path specified. (didn't work) C:\PROJECTS\replyto>cd c:\projects (does work) C:\PROJECTS>
4. More examples:
Evidently sometimes the "forwards slash" works at the command line and sometimes it doesn't. There appears to be something special about drive root and I suppose some of these commands like "type" can get confused between path and "/" options.C:\PROJECTS>type testing/test.pl (doesn't work) The syntax of the command is incorrect. C:\PROJECTS>type "testing/test.pl" (doesn't work either) The system cannot find the file specified. C:\PROJECTS>type "testing\test.pl" (works) C:\PROJECTS>type testing\test.pl (works) C:\PROJECTS>cd ./testing (works) C:\PROJECTS\testing> C:\PROJECTS>cd /testing (works) C:\PROJECTS\testing>
5. In an attempt to try and avoid confusion, when writing Perl, I always use forward slash. That works with all Perl functions even with a path like c:/projects. As long as you don't go the the shell with say a command('blah'), forward slash is the way to go.
In reply to Re^3: Trouble using a Win32 file path in an array
by Marshall
in thread Trouble using a Win32 file path in an array
by geo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |