
On Mon, Sep 22, 2008 at 14:48, Johan RĂ¥de <rade@maths.lth.se> 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 wildcards.) Is there a really good solution? I don't know. It seems like I can even have newlines in filenames: $ touch '1 2' $ ls 1?2 $ 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