Boost logo

Boost :

Subject: Re: [boost] filesystem::create_directories error
From: Zachary Turner (divisortheory_at_[hidden])
Date: 2010-03-24 08:48:35


On Mar 24, 2010, at 5:04 AM, Ilie Halip <lupuroshu_at_[hidden]> wrote:

> On Wed, Mar 24, 2010 at 12:42 AM, Zachary Turner <divisortheory_at_[hidden]
> >wrote:
>
>> I'm trying to use boost::filesystem::create_directories() with a
>> path of
>> the
>> form \\?\Volume{Guid}\foo on windows. This seems to break the
>> filesystem
>> library because it doesn't understand the path syntax. when
>> recursing up
>> the parents it removes the slash at each level, so it ends up calling
>> boost::filesystem::exists(L"\\?\Volume{Guid}") which always returns
>> false,
>> I
>> think because GetFileAttributes() requires that paths in this
>> syntax end
>> with a trailing \, whereas the trailing \ has been removed.
>>
>> I'm tempted to fix this, but I'm sure this algorithm is fragile and
>> any
>> change I apply is likely to break another case. Does anyone have any
>> suggestions on how to fix this?
>>
>> Thanks
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>>
>
> That's right. With this simple test:
>
> char volPath[MAX_PATH] = {0};
> char *volMount = "C:\\";
> GetVolumeNameForVolumeMountPointA(volMount, volPath, MAX_PATH);
> strcat(volPath, "foo\\");
> fs::create_directories(volPath);
>
> , it fails, because, when checking the parent dir, it removes the
> trailing
> \.
>
> Also, this is related to https://svn.boost.org/trac/boost/ticket/2138
>
> Ilie.
> _______________________________________________
>

Can you see any problem with applying a fix where we just dont remove
the trailing slash before recursing?

Zach


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk