I have a file in a directory that is returned from
Directory.GetFi les() but subsequently fails a File.Exists() check.
Test code:
string p = @"C:\documen ts and settings\all users\" +
@"applicatio n data\macromedia \fms";
foreach(string path in Directory.GetFi les(p)) {
if ( ! File.Exists(pat h)) {
foreach(char c in Path.GetFileNam e(path)) {
Console.WriteLi ne((int)c);
}
}
}
prints out this:
160
160
160
32
160
160
160
That's the real directory, the one file in it was created by Flash
Media Server and is very small, just has some numbers in it followed
by a null-byte. In explorer the name looks like it's blank. I can
open it in other apps (Notepad), but in .NET I get
FileNotFoundExc eption trying to access it.
Any explanation as to what .NET is doing here? This has got to be a
bug, right?
Working with .NET 2.0.
Thanks,
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
Directory.GetFi les() but subsequently fails a File.Exists() check.
Test code:
string p = @"C:\documen ts and settings\all users\" +
@"applicatio n data\macromedia \fms";
foreach(string path in Directory.GetFi les(p)) {
if ( ! File.Exists(pat h)) {
foreach(char c in Path.GetFileNam e(path)) {
Console.WriteLi ne((int)c);
}
}
}
prints out this:
160
160
160
32
160
160
160
That's the real directory, the one file in it was created by Flash
Media Server and is very small, just has some numbers in it followed
by a null-byte. In explorer the name looks like it's blank. I can
open it in other apps (Notepad), but in .NET I get
FileNotFoundExc eption trying to access it.
Any explanation as to what .NET is doing here? This has got to be a
bug, right?
Working with .NET 2.0.
Thanks,
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
Comment