Geeks With Blogs


View Anthony Trudeau's profile on LinkedIn

Add to Technorati Favorites

Anthony Trudeau

Does anyone have a compelling reason why System.IO.File.ReadAllText throws a System.IO.IOException when you call it when the file is being written to?  Obviously, the cause of the exception is that internally it allows only Read sharing.  But, why?

It's not a terribly big issue, because creating the System.IO.FileStream and passing that to the System.IO.StreamReader is trivial.  However, that doesn't quell my curiousity.  Is it an implementation bug, or was it intentional?

Posted on Monday, January 4, 2010 1:34 PM .NET | Back to top

Comments on this post: System.IO.File.ReadAllText Doesn't Allow Shared Writing

# re: System.IO.File.ReadAllText Doesn't Allow Shared Writing
Requesting Gravatar...
i need information
Left by uday on Apr 15, 2010 12:53 AM

Your comment:
 (will show your gravatar)

Copyright © Anthony Trudeau | Powered by: