Text Files: How To

  • Thread starter Thread starter Chang
  • Start date Start date
C

Chang

hello ng,

how can I read/write/clear a ascii text file in one go (same also for
binary file). also while i am doing that no other application/process should
be able to read/write/clear to that file. also what process/method should i
call to see if there is any read/write/clear is happening on a file.

thanks,
c
 
You can seek around files all you like, but the ability to read/write/clear the
file
in one pass is going to be very specific to the type of file you are working
with.

For your scenario, you'll want to open the file using FileShare options.
Specifically
you are looking for FileShare.None. If you can't obtain exclusive access to the
file
you'll get an exception.
 

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