Boost logo

Boost Users :

From: Nat Goodspeed (ngoodspeed_at_[hidden])
Date: 2007-02-03 23:15:01


________________________________________
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Nathan Pierluissi
Sent: Saturday, February 03, 2007 5:53 PM
To: boost-users_at_[hidden]
Subject: [Boost-users] [Filesystem] Folders with spaces in the name

I am having trouble using the /= operator to open folders with spaces in the name, ex. "My Documents" or "Program Files".  Here is an example code:
 
path full_path("c:\");
string Fname="Program Files";
full_path/=Fname;
 
It works for any Fname (folder name) that doesn't have a space.  Let me know if you need more information. Thanks in advance.

[Nat] You didn't explain the nature of your 'trouble,' but if you're encountering exceptions, it's probably the default boost::filesystem::path syntax checker. Try explicitly disabling that rather than letting operator/= implicitly convert your string to boost::filesystem::path with the default checker, e.g. (neither compiled nor tested):

full_path /= path(Fname, no_check);


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net