Jump to content
  • Advertisement
Sign in to follow this  
jimywang

how to create a folder in C++

This topic is 5461 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

this might be a stupid question.but I really wanna know how I can create and delete a folder in C++.thanks in advance. regards

Share this post


Link to post
Share on other sites
Advertisement
It's platform-specific. mkpath for UNIX (look up the header), CreateFile for Windows.

Alternatively, you can cheat. Create a file using fstream and all the directories in the path will be created as well. Then use unlink to remove the file.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi,
If you're talking about creating and deleting a directory in the exterior OS, and that OS is windows, then CreateDirectory and RemoveDirectory and your friends - a search on MSDN will probably find them (if not, have a look in Petzold).

Share this post


Link to post
Share on other sites
I am sorry I should of made it clear.all I want to do is create a empty folder in windows from a C++ program and delete it later on.what is the easiest way to do it?thanks in advance.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!