in reply to perl windows backtick problem

Geez. I am having trouble understanding your core problem.

This 8.3 naming stuff is "bad juju". Using WinXP or later, there is no reason to work with an 8.3 name. The 8.3 name for a given file varies depending upon other similar files which are in that directory and would "hash" to the same 8.3 name! There is no fixed 8.3 name for a Windows NTFS file name.

Also, with Win XP (or greater) in most (not all) cases, you can use "/" instead of "\", so this confusing "\\" stuff is not necessary.

What does this mean: the "______" to the external command has some special characters in it.?

Update:
I ran some quick tests...

C:\PROJECTS>dir //$home Invalid switch - "/". C:\PROJECTS>dir /$home Invalid switch - "$home". C:\PROJECTS>dir \\$home The filename, directory name, or volume label syntax is incorrect. C:\PROJECTS>dir \$home Volume in drive C is Main-Max Volume Serial Number is 89D1-9F45 Directory of C:\ File Not Found C:\PROJECTS>dir "\$home" Volume in drive C is Main-Max Volume Serial Number is 89D1-9F45 Directory of C:\ File Not Found C:\PROJECTS>dir c:\ Volume in drive C is Main-Max Volume Serial Number is 89D1-9F45 Directory of c:\ MANY..MANY files....meaning that windows had trouble with: dir "\$home +"
It is important that you show us exactly the code that you are using. Try again and please pay attention to what I said about 8.3 names -> don't use them! Somewhere I have the algorithm for generating 8.3 names, but it might take me a couple of hours to find it. But this one of those deals where if you have all of the information to generate the 8.3 name, then you don't need the 8.3 name! Use the NTFS 32 character name!

Replies are listed 'Best First'.
Re^2: perl windows backtick problem
by Anonymous Monk on Sep 21, 2011 at 22:29 UTC

    I ran some quick tests...

    All you've demonstrated is that the cmd.exe built-in command "dir" uses / for processing arguments, as documented

    $ "C:/MinGW/msys/1.0/bin/dir.EXE" asdf "C:/MinGW/msys/1.0/bin/dir.EXE": asdf: No such file or directory $ "C:\MinGW/msys/1.0/bin\dir.EXE" asdf "C:/MinGW/msys/1.0/bin/dir.EXE": asdf: No such file or directory $ C:\MinGW/msys/1.0/bin\dir.EXE asdf /usr/bin/dir: asdf: No such file or directory $ C:\MinGW/msys/1.0/bin\dir.EXE\$HOME asdf The directory name is invalid. $ C:\MinGW/msys/1.0/bin\dir.EXE\blah.exe The directory name is invalid.

    This 8.3 naming stuff is "bad juju".

    Yup, that is why there is NtfsDisable8dot3NameCreation, but it does have benefits

    8.3 saves you the trouble of quoting paths in the shell, say for batch files and the like

    8.3 spares you the headache of dealing with broken programs that don't quote paths they give to the shell, like legacy applications

    8.3 spares you the headache of dealing with broken programs that split on whitespace

      But the BIG disadvantage is that there is no 1->1 mapping between the NTFS name and the 8.3 name! It is not possible to uniquely map a 32 character name into an 8 character name! ABCDEFGHIJ.EXE will have a different 8.3 name on different systems depending upon what other files are in the directory.

      Let's see what the OP (original poster) has to say. I am curious as to the application...

        But the BIG disadvantage is that there is no

        HA!

        8.3 is a feature to support legacy applications developed for legacy filesystem

        It was never supposed to be a 1-to-1-mapping or relocatable between systems, that is impossible problem