Skip Menu |

This queue is for tickets about the PathTools CPAN distribution.

Report information
The Basics
Id: 37348
Status: open
Priority: 0/
Queue: PathTools

People
Owner: Nobody in particular
Requestors: CHOCOLATE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Wishlist: escape (or quote or normalize) filenames
Hi. It would be nice if one could take a raw filename e.g. "foo's bar.baz" and have it escaped (or quoted or normalized) so that it can be accessed without tears on various platforms e.g. on Unix "foo\'s\ bar.baz". i.e. a kind of platform-specific quotemeta() for filenames. See http://rt.cpan.org/Ticket/Display.html?id=37347 chocolateboy.
Le 2008-07-03 00:22:44, CHOCOLATE a écrit : Show quoted text
> Hi. > > It would be nice if one could take a raw filename e.g. "foo's bar.baz" > and have it escaped (or quoted or normalized) so that it can be accessed > without tears on various platforms e.g. on Unix "foo\'s\ bar.baz". > > i.e. a kind of platform-specific quotemeta() for filenames.
Your use case seems to be for passing the filename as an argument when launching an external command using a shell. String::ShellQuote exists, but unfortunately it is not cross-platform. https://metacpan.org/module/String::ShellQuote -- Olivier Mengué - http://search.cpan.org/~dolmen/ http://github.com/dolmen/