On 8/22/2018 6:21 AM, Konovalov, Vadim wrote:
I wonder if quotemeta enough??

I don't think that will work on Windows, because it escapes "too much" as it were. But double quotes might be enough: it will work with e.g.

        "C:\New folder\..\ActiveTcl\bin\tclsh.exe"

but not

        C\:\\New\ Folder\\\.\.\\ActiveTcl\\bin\\tclsh\.exe

(gives error "'C\:\\New\' is not recognized as an internal or external command, operable program or batch file.")

nor both (gives error "The filename, directory name, or volume label syntax is incorrect.").

For reference, the current error if there's a space: "'C:\New' is not recognized as an internal or external command, operable program or batch file."


I haven't thought of an issue with using quotemeta (presumably without double quotes) on UNIX though, since at least bash seems fine with things being \-escaped.


Still, I'm somewhat uneasy about putting this kind of logic, but it's probably better than leaving it how it currently is, and there's little else to do with using core Perl.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply via email to