문제

I want to copy a file from directory to another, but my program always aborts for some reasons.Has anyone done this this before could tell me what was wrong? And how could I catch exceptions was thrown by copy_file, I checked boost site, but I could not find any relevant information about exception.

path user_path( "C:\\My Folder" );
boost::filesystem::create_directory( user_path );
path file(  "C:\\Another\\file.txt" );
boost::filesystem::copy_file( file, user_path );

Thanks,

도움이 되었습니까?

해결책

You have to provide a path to a file name, not just the directory it resides in.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top