Boost logo

Boost Users :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-12-11 15:06:37


At 12:57 PM 12/11/2003, Scott Meyers wrote:

>On Thu, 11 Dec 2003 08:32:06 +0100, Galante Michele wrote:
>> int processFile(const fs::path& fileName)
>> {
>> fs::path copyFileName(fileName.string() + ".bak");
>> fs::copy_file(fileName, copyFileName);
>> }
>
>I had tried this before. It also throws.

It would have to be:

    int processFile(const fs::path& fileName)
    {
        fs::path copyFileName(fileName.string() + ".bak", fs::native);
        fs::copy_file(fileName, copyFileName);
    }

I'd probably write it like this, just for stylistic reasons:

    int processFile(const fs::path& fileName)
    {
        fs::copy_file(fileName,
                fs::path(fileName.string() + ".bak", fs::native));

    }

Also, if you haven't already done something similar, change the name of
your main() function to cpp_main, after adding:

    #include <boost/test/included/prg_exec_monitor.hpp>

That will turn the exceptions into something more readable.

--Beman


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