Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create directory from boost::filesystem succeeds, however no dir is created

I have the following code, and although the call to boost::filesystem::create_directory returns true, I see no directory created in my project folder.

What could be the reason for this?

boost::filesystem::path dir("newdir");
if (boost::filesystem::create_directory(dir))
    std::cout << "Success" << "\n";

I'm using VS2008 and Win7 Home Premium.

like image 220
Tony The Lion Avatar asked Dec 05 '11 15:12

Tony The Lion


2 Answers

Could you be looking in the wrong place for it? A quick call to cout << current_path().string() << endl; will show you where your directory is being created.

like image 198
endian Avatar answered Sep 28 '22 00:09

endian


You could be suffering from folder virtualization. Also try creating a directory with the full path so that you are not affected by whatever current application directory is

like image 29
parapura rajkumar Avatar answered Sep 28 '22 00:09

parapura rajkumar