locking files for duration of an application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a windows application whose purpose is to read in an xml data file,
allow editing of the data, and finally write the data file back out to the
file.

What's the best way to lock the xml file for the duration of the application?
 
One approach is to open it "for write", using the access
(System.IO.FileAccess) parameter of some constructors of FileStream.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
Back
Top