Boost logo

Boost Users :

Subject: [Boost-users] Can't find copy_file() with copy_option
From: Hite, Christopher (Christopher.Hite_at_[hidden])
Date: 2010-05-26 15:39:50


This doesn't work:

        using namespace boost::filesystem;
        copy_file(tmpFileName,fname,copy_option::overwrite_if_exists);

error: no matching function for call to 'copy_file(std::string&,
std::string&, boost::filesystem::copy_option::enum_type)'
/fs/tools/L1/boost_1_43_0/boost/filesystem/operations.hpp:742: note:
candidates are: void boost::filesystem::copy_file(const
boost::filesystem::path&, const boost::filesystem::path&)
/fs/tools/L1/boost_1_43_0/boost/filesystem/operations.hpp:744: note:
void boost::filesystem::copy_file(const boost::filesystem::wpath&, const
boost::filesystem::wpath&)

This does:

        detail::copy_file_api(tmpFileName,fname,
copy_option::overwrite_if_exists);

Platform is Linux+gcc. It looks like these definitions are the only ones
exposed:

    inline void copy_file( const path & from_path, const path & to_path
)
      { return copy_file<path>( from_path, to_path ); }
    inline void copy_file( const wpath & from_path, const wpath &
to_path )
      { return copy_file<wpath>( from_path, to_path ); }

This doesn't fly either though:
        
copy_file<std::string>(tmpFileName,fname,copy_option::overwrite_if_exist
s);

The version I'm after is there:
http://www.boost.org/doc/libs/1_43_0/libs/filesystem/doc/reference.html

It would be nice to have a move/rename with this functionality. I'm
going to stick with std::rename().



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