Boost logo

Boost :

Subject: Re: [boost] [filesystem] basic_path::operator>> issue for paths with spaces
From: Scott McMurray ([hidden])
Date: 2008-09-22 15:24:52

On Mon, Sep 22, 2008 at 14:48, Johan RÃ¥de <rade_at_[hidden]> wrote:
> I don't know. I only have experience with Windows,
> where spaces are common and "s are not allowed in path names.
> It is a common convention on Windows
> to surround paths, that contain spaces, by quotes.
> How is this problem handled on Unix?

Quotes are usually used, which are parsed out by the shell. For
filenames with quotation marks, then escaping is needed, or a
different method, such as apostrophes. In all cases, though, the
shell has stripped the excess before passing the appropriate filename
to the program. (The shell is also responsible for expanding

Is there a really good solution? I don't know. It seems like I can
even have newlines in filenames:

$ touch '1
$ ls
$ rm 1?2
rm: remove regular empty file `1\n2'? y

It seems operator>> would need the full parsing capabilities of a
shell, and operator<< would perform escaping, not unlike what rm seems
to do (just with quotation marks, for round-tripping).

~ Scott

Boost list run by bdawes at, gregod at, cpdaniel at, john at