Resolved Problem with directory names ending with space character

forevernoob

New member
Joined
May 12, 2009
Messages
3
Programming Experience
10+
Hi Folks,

I have a function that scans a directory tree and creates a list of directories and files. For each directory I call DirectoryInfo.GetDirectories() method to get a list of children. At some point I get an exception because one of the directories has a space character at the end, and the DirectoryInfo object that is returned for it has Exists = False. Is there a way I can deal with it w/o fixing the directory name?

TIA
 
Last edited:
I was trying to test your situation but I was unable to create a folder with a space at the end of the name, either in Windows Explorer or in VB code.

hi jmcilhinney,

I'm sorry, I forgot to mention this is not a real file system but rather a Sharepoint 2001 web store mounted as a disk drive. Not sure if it matters.

Thank you
 
[solved]

hi jmcilhinney,

I'm sorry, I forgot to mention this is not a real file system but rather a Sharepoint 2001 web store mounted as a disk drive. Not sure if it matters.

Thank you

Just found a legal way to change the directory name and remove the trailing space. Thanks.
 
Back
Top