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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top