Click to See Complete Forum and Search --> : Directory name with spaces
Bing Mou
February 27th, 2003, 01:52 PM
The Windows API CreateDirectory() can create a directory like "C:\ test ". It contains space at the beginning and the end of the folder name.
The question is how to delete it.
RemoveDirectory() doesn't work with this kind of directory.
Caronte
February 27th, 2003, 02:22 PM
It functions, but the directory created doesn´t contain spaces... they are removed.
You can RemoveDirectory with the same path without spaces.
Bing Mou
February 27th, 2003, 03:34 PM
It doesn't remove the spaces on W2K.
Which operation system you are using?
Bing Mou
February 27th, 2003, 04:54 PM
I made a mistake in the first post.
When I called the CreateDirectory. I passed “C:\ Test \” instead of “C:\ Test “. In this case it doesn’t remove the spaces. Later I found I couldn’t delete the directory in Window Explorer. It says, “Cannot read from the source file or disk”. So I try the RemoveDirectory and I passed “C:\ Test “. It didn’t work.
However, I have just found if I say RemoveDirectory(“C: \Test \”), it works.
It is an interesting thing.
KingTermite
February 28th, 2003, 08:56 AM
Just another shining example of why I don't use spaces in directories. MS's WinAPI doesn't truly support it right. My request is this (to MS)....if you are going to allow it, then support it properly in the WinAPI. If you aren't going to support it properly, then don't allow it.
I've gone through many headaches over this very type problem.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.