How to waste computer memory?

Chris Angelico rosuav at gmail.com
Sat Mar 19 11:45:08 EDT 2016


On Sun, Mar 20, 2016 at 2:05 AM, Michael Torrie <torriem at gmail.com> wrote:
> Of course not.  Shells already associate specific meaning with certain
> characters that can be used in file names.  For example the various
> quoting characters, such as ' or ". These can be used in file names but
> when referred to in the shell are escaped.  So it could be with path
> separators. The file system itself could have no separators at all and
> the shell could still use "/" to delineate the parts of the path on the
> command line.  so
>
> ls -l /home/user/documents/stuff/foo
>
> would still work as would:
>
> ls -l /home/user/documents/music\/fun/foo.

That only escapes the slash *to the shell*. The application receives
it exactly as is. You would have to have multiple levels of escaping
to prevent the file system from parsing that; it's like trying to use
the 'grep' command to locate strings containing backslashes...

ChrisA



More information about the Python-list mailing list