PyCharm показывает вам список установленных пакетов с pip
, а conda list
показывает и pip
, и conda
. Между тем, вы можете переключаться между pip
и conda
с помощью специальной кнопки в PyCharm:
Есть третий enum аргумент для copy_file, boost :: filesystem :: copy_option :: overwrite_if_exists
copy_file(source_path,destination_path,copy_option::overwrite_if_exists);
Test if the destination file exists first and if it does then remove it :
if (exists (to_fp))
remove (to_fp);
copy_file (from_fp, to_fp);
Or if you're worried about the file appearing between the test and the copy then you could write to a temporary file and then rename it to the destination file.
Is there an elegant way to use the boost copy_file function and overwrite the target file?
Apparently there's no direct API to do this.
Or is it better to simply use the Windows API? My current target platform is Windows, but I prefer to use STL and boost where possible to keep my code platform independent.
From the documentation:
A proposal, N1975, to include Boost.Filesystem in Technical Report 2 has been accepted by the C++ Standards Committee. The Boost.Filesystem library will stay in alignment with the TR2 Filesystem proposal as it works its way through the TR2 process. Note, however, that namespaces and header granularity differs between Boost.Filesystem and the TR2 proposal.
Which strongly suggests that sticking with boost::filesystem
is a good idea.