Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.filesystem] remove issue
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2009-05-17 17:55:15


Hi!

probably you are trying to remove a directory? If so try using remove_all
instead.

Regards,
Ovanes

On Sun, May 17, 2009 at 11:07 PM, Sean Farrow
<sean.farrow_at_[hidden]>wrote:

> Hi:
> I am using the following code with boost.filesystem:
> size_t origsize = strlen(argv[0]) + 1;
> size_t convertedChars = 0;
> wchar_t wcstring[1024];
> mbstowcs_s(&convertedChars, wcstring, origsize, argv[0],
> strlen(argv[0]));
> boost::filesystem::wpath path(wcstring);
> path.filename() =L"compilation date.txt";
> if (boost::filesystem::exists(path))
> // boost::filesystem::remove(path);
> I have defined:
> #define BOOST_FILESYSTEM_NO_DEPRECATED
> The line that causes probles is:
> // boost::filesystem::remove(path);
> Anyone got any ideas why this line causes a window error report to be
> generated.
> For reference I'm including:
> #include <stdlib.h>
> #include <fstream>
> #include <boost/date_time/gregorian/gregorian.hpp>
> #include <boost/filesystem/path.hpp>
> #include <boost/filesystem/operations.hpp>
> #include <string>
> Cheers
> Sean.
>
>



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