I have a mapped drive to a Linux mount and need to search for files. One of the directories has a trailing space in the name and this produces the DirectoryNotFoundException error when using the DirectoryInfo.GetFiles method. It seems the method trims the trailing space by default. I am hoping someone has found a workaround for this issue. I'm using C# 2005. I also get the same error when using the GetFileSystemInfos method.