|
Boost : |
Subject: Re: [boost] [Boost-commit] svn:boost r62919 - in trunk: boost/filesystem/v2 boost/filesystem/v3 libs/filesystem/v2/test libs/filesystem/v3/test
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2010-06-15 22:37:29
On 15 June 2010 08:09, Beman Dawes <bdawes_at_[hidden]> wrote:
>
> Using double quotes as delimiters works well for legitimate uses in
> both Windows and bash shells, is readable by humans, and avoids the
> need for escapes in the vast majority of all real-world path names.
>
Unless someone accidentally makes a filename with a $ in it, or in
bash one one with a ! in it, or in windows one with two %s in it.
>
> In your example, the call to system would become system("rm \"-f
> x\""), and that will be harmless for both Windows and bash shells.
>
Except that in linux, the rm command sees the - and gives an argument
parsing error.
That's by no means the fault of the filesystem library, but it's be
great if it were handled gracefully, since we have a type system and
know that the coder isn't trying to specify flags.
(I suppose theoretically there could be a problem in windows too, with
a linux-thinking script running something like "del /test.txt" and
getting "Invalid switch - "test.txt".")
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk