[Mono-dev] DirectoryInfo cache

Atsushi Eno atsushi at ximian.com
Thu Dec 27 05:13:58 EST 2007

The sample code is wrong. Directory.Delete(DirectoryInfo) does not
exist. If you mean Directory.Delete(string) then it is an expected
behavior as Robert pointed out (DirectoryInfo is a cache).
After DirectoryInfo.Delete(), its "Exists" property returns false.

Atsushi Eno

Jerome Haltom wrote:
> DirectoryInfo i = new DirectoryInfo("/tmp/foo");
> i.Create();
> Directory.Delete(i);
> i.Exists();   <--- this returns true
> DirectoryInfo and FileSystemInfo have some sort of cache on them. I'm
> hard pressed to understand what the goal of this cache is. The file
> system should do Just Fine.
> Beyond that, DirectoryInfo.Delete() and MoveTo don't actually invalidate
> the cache.
> Opinions?
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list