Saturday, 24 August 2013

Directory.GetFiles() removes dashes from filenames?

Directory.GetFiles() removes dashes from filenames?

My debug output takes the values straight from this in the loop and shows
me the raw data coming from Directory.GetFiles(). It is showing what I
expect, except that one file has a dash in its name that it is removing
for no reason. As a result the program can't access the file because it
triggers an IO exception.
I mean really? What genious at microsoft thought he could get away with
removing chars from file names and not break stuff? This makes no sense
and looks like just plain stupidity from where I'm sitting.
The code is a simple for loop iterating over the results of
Directory.GetFiles(). It dumps each str from GetFiles() straight into the
debug stream without doing anything whatsoever to it. I have no idea why
it is removing the dash for no reason, but the debug output proves that
Directory.GetFiles() is doing it.

No comments:

Post a Comment