Re: The format of filename



Some experimentation shows that Python does seem to provide
*some* translation. Windows lets me use '/' as a path separator,
but not as the name of the root of a partition name. But perhaps
this a peculiarity of the commands themselves, and not of Windows
path names in particular.

C:\PYTHON24>CD /
The syntax of the command is incorrect.
C:\PYTHON24>CD \
C:\>EDIT /PYTHON24/README
The syntax of the command is incorrect.

The Windows APIs all accept either forward slashes or back, and have done
so clear back to Windows 3.0. However, the Windows command shells do not.
That's what you're seeing here.

What one finds is that the command-shell is self-inconsistant:

C:\temp>md foo
C:\temp>md foo\bar
C:\temp>cd foo/bar
C:\temp\foo\bar>cd ..
C:\temp\foo>cd ..
C:\temp>cd /foo/bar
C:\temp\foo\bar>cd \temp
C:\temp>md foo/baz
The syntax of the command is incorrect
C:\temp>echo dir > foo/bar/pip
C:\temp>echo dir > /foo/bar/pip
The system cannot find the path specified.
C:\temp>dir foo/bar
Parameter format not correct - "bar".
C:\temp>dir /b foo\bar
pip
C:\temp>type foo/bar/pip
The syntax of the command is incorrect.
C:\temp>type foo\bar\pip
dir
C:\temp>cmd < foo/bar/pip
[directory listing within a subshell]
C:\temp>cmd < /foo/bar/pip
The system cannot find the path specified.


The CD, MD, TYPE, ECHO and redirection are all shell-builtins, yet they seem to be conflictingly quasi-smart about forward slashes.

Sometimes leading slashes matter. Sometimes they don't. Sometimes forward slashes are acceptable. Sometimes they aren't. All within the shell's built-in mechanisms. Go figure.

-tkc




.



Relevant Pages

  • >>>> NET SEND <<<<
    ... Windows Xp Net Send ... Net Send Command For Mac ... Net Send Syntax Dos ... Dos Net Send Commands ...
    (sci.lang.japan)
  • Re: Cannot delete files with invalid filenames
    ... Have you tried isolating these file in a folder, ... use the rd command with the /s switch to remove the ... Microsoft Windows MVP ... Every deletion tool and syntax basically says "The filename, ...
    (microsoft.public.win2000.file_system)
  • Re: renaming files in directory
    ... 39The syntax of the command is incorrect. ... Univ. of California, Berkeley ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: renaming files in directory
    ... phil when i try it this is what i get... ... 39The syntax of the command is incorrect. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: The program issued a command but the command length is incorrect
    ... The program issued a command but the command length is incorrect ... MS-MVP Windows Shell/User ... Windows Update), at logon, after entering the correct, AND VALID, ... "The program issued a command but the command length is incorrect. ...
    (microsoft.public.windowsxp.general)