Jump to content
  • Advertisement
Sign in to follow this  
AndiDog

Can't delete folder with spaces

This topic is 4256 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

When creating a folder "foldername " (with spaces at the end!) using the mkdir function, I can't delete it afterwards, not even with rmdir. I think the problem is the C++ runtime library that does not prevent such folders to be created (but I can't make one with my mouse and keyboard ^^). Is there a way (or a tool) to delete it anyway (file system is NTFS) or do I really have to search for a Linux Live-CD ???

Share this post


Link to post
Share on other sites
Advertisement
Yes, it is empty.

I could imagine just erasing the folder entry on the hard disk, but I don't know much about it (don't wanna risk to crash the disk).

Share this post


Link to post
Share on other sites
Just a thought, but if you get a command prompt to the directory the directory is in and do

dir /x

that will give you the old DOS name for the directory, which will not have spaces in, like Program Files is progra~1 for example.

You may be able to pass that name as an argument to the rmdir() function and it may work. Not really a long term solution.

I wasn't quite clear - are we talking about a rmdir() C/C++ function or the rmdir DOS command?

Share this post


Link to post
Share on other sites
Well when you navigate to such directories in cmd you have to do:

cd c:/docume~1

So try something like that, pass the name of the folder by passing the first 6 letters and then ~1, ~2 if you are trying to remove the second of two entries with the same first 6 letters.

Dave

Share this post


Link to post
Share on other sites
Alright, it worked with the 8.3 notation. In the console, I could only navigate into the base directory, but "dir /X" shows the short name.

Then, "rmdir 88888888.333" (replaced with my folder's name) worked fine.

Thanks guys :)



@EasilyConfused: I meant the C++ functions mkdir/rmdir

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!