views:

295

answers:

1

What does this display on OSX? Can anyone run this on their machines using Mono?

foreach (char c in System.IO.Path.GetInvalidPathChars())
{
   Console.Write((byte)c);
   Console.Write(", ");
}

and what does this display:

foreach (char c in System.IO.Path.GetInvalidFileNameChars())
{
   Console.Write((byte)c);
   Console.Write(", ");
}

For reference, I'm including the output of GetInvalidPathChars in Windows and Linux.

Output in Windows: 34, 60, 62, 124, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1 8, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,

Output in openSUSE: 0,

Furthermore, I'm including the output of GetInvalidFileNameChars in Windows and Linux.

Output in Windows: 34, 60, 62, 124, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1 8, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 58, 42, 63, 92, 47,

Output in openSUSE: 0, 47,

Regards,

_NT

+1  A: 

The output on Mac OS X is the same as on Linux:

GetInvalidPathChars: 0, GetInvalidFileNameChars: 0, 47,

Thomas Gerstendörfer
It would be interesting to run this on differently mounted filesystems. Can someone run this on Linux or Mac when run from a FAT filesystem?
maxwellb