allowing exclusive access to a file on the network

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

I have a desktop application which uses AxPdf to view PDF file.

axPdf.LoadFile("myFile.PDF");

Without going into much detail, I need to make sure that only one person
has a given file in the PDF viewer. So before calling LoadFile, I need
to make sure that nobody else is reading the file.

Played around FileSystemInfo to see if there is a property that is
indicative of whether the file is being read or not, but couldn't find
one.

Thanks in advance.
 
It depends on how the AxPDF application loads a file. Some load into
memory and release the lock after the file is read. Some maintain a
lock on the file. If this application maintains a lock, then you could
try to aquire write access and if denied, handle the exception
properly. If the application does not lock the file and you need a
custom lock, then you need to write a system that will lock and unlock
the files for you. Depending on your requirements, this system could
be written in a lot of different ways...if you want to provide details
of you system I can help recomend solutions to fit.

Hope this helps,
-- mm
 

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