More robust file system in .net

Let me rephrase. My example was probably not good. An error may occur when deleting a directory. The file has a set of readonly attributes, the directory is opened by Windows Explorer. I think they can all be handled - however I don't want to do this on my own - is there a wrapper that takes care of this with a simple api?

I found that the file system operations in System.IO are inadequate. For example, if a file is opened in a text editor, the file cannot be saved.

I was wondering if there is a more powerful file system implementation for .net?

0


a source to share


3 answers


what text editor? How do you open a file for writing? I am writing to a log file all the time and am not having this problem.



It seems a bit rash to ditch System.IO for this reason.

+3


a source


It doesn't matter what you use, you cannot write a file that is locked.



This is not a limitation of the .NET platform, this is how the file system works.

+2


a source


Almost all System.IO calls are only wrappers for kernel32.dll. Forwarded jumps are similar to enums from pinvoked kernel32, so:

System.IO.File.Create(@"C:\test.txt",1024,FileOptions.Asynchronous)

      

What FileStream uses is uses kernel32 WriteFile

+1


a source







All Articles