> I have a thorny problem.
> I am wanting to open a file but before I do I need information about that
file.
>
> I need to know the following:
> Does anyone else have the file open?
> Do they have that file opened exlusively?
>
> I need to be able to answer these two questions BEFORE I try to open the
> file.  In otherwords I can't try opening the file as a test of these
> conditions.
>
> Any Ideas? I'm stumped.

umm shouldn't you be able to do a

try
   FS := TFileStream.Create(...);
except
   // catch the exception if the file was already open
end;

Short of some API searching I'd guess the easiest way to identify if they
have
exclusive open is to try to open it with sharing.  If you need to use the
file exclusively
then open with no file sharing.

--
Aaron@home

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to