home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!mary.fordham.edu!sbhatia
- From: sbhatia@mary.fordham.edu (SABU)
- Subject: file sharing under DOS (share not necessarily loaded)
- Organization: Fordham University
- Message-ID: <12SEP199200133096@mary.fordham.edu>
- News-Software: VAX/VMS VNEWS 1.41
- Sender: nobody@ctr.columbia.edu
- Date: Sat, 12 Sep 1992 04:13:00 GMT
- X-Posted-From: mary.fordham.edu
- X-Posted-Through: sol.ctr.columbia.edu
- Lines: 30
-
- Hi,
-
- I have to implement a general purpose moule for file locking uder
- dos. I cannot safely assume that share is loaded as we do have
- some users who tinker around with their autoexec.bat and thus
- donot load share.
- I have successfully implemented a sceheme for VAX/VMS (not using the
- lock manager) now I would like to do something like this
- for dos but there are problems. The basic problem is say that a user
- has three windows open and the same program is running, which accesses
- the same dataf file. Two processes request reads and they are successful
- that's what I want so it is ok. But the third process comes
- in and requests a read operation. Initially I thought that it would
- be denied the permission to access the file that is open() would
- return a -1 but it doesn't it successfully returns a file handle. Is there
- some way that I can test the file control block or something to see
- that whether at a certain time some other process is accessing the
- file for either a read or a write.
-
- thanks,
-
-
- sabu
-
- ////////////////////////////////////////////////////////////////////////
- / Internet: SBHATIA@mary.fordham.edu /
- / BITnet: SBHATIA@FORDMULC /
- / /
- / /
- ////////////////////////////////////////////////////////////////////////
-