From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4ebc49648f2201b0 X-Google-Attributes: gid103376,public From: kst@sd.aonix.com (Keith Thompson) Subject: Re: File/Record locking in Ada Date: 1997/03/01 Message-ID: #1/1 X-Deja-AN: 222301634 Sender: news@thomsoft.com (USENET News Admin @flash) X-Nntp-Posting-Host: pulsar References: <3313101D.1BBF@aston.ac.uk> <01bc259a$a035e850$fc00af88@godiva> Organization: Aonix, San Diego, CA, USA Newsgroups: comp.lang.ada Originator: kst@pulsar Date: 1997-03-01T00:00:00+00:00 List-Id: In <01bc259a$a035e850$fc00af88@godiva> "Keith Allan Shillington" writes: > Hmmm. That would be a protected type. I don't think so. A protected type can protect access to a resource within a single (possibly multi-tasking) program, but not between different programs running independently on the same system. Since files are shared across multiple independent programs, protected types won't work for file locking. What you really want is something like the POSIX_File_Locking package. If you don't have a working implementation of that, you may be able to interface to fcntl(). According to IEEE 1003.5, the Get_Lock, Set_Lock, and Wait_To_Set_Lock routines correspond to fcntl(F_GETLK), fcntl(F_SETLK), and fcntl(F_SETLKW), respectively. -- Keith Thompson (The_Other_Keith) kst@sd.aonix.com <*> TeleSo^H^H^H^H^H^H Alsy^H^H^H^H Thomson Softw^H^H^H^H^H^H^H^H^H^H^H^H^H Aonix 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2706 "Humor is such a subjective thing." -- Cartagia