TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Reply To:
Thu, 23 Nov 2000 09:51:07 GMT
text/plain (29 lines)
Is there a PORTABLE way of using POSIX_5 file-locking with Ada files:


or is one forced to use Posix IO as well?  Is there a way of doing
this that would be portable just across different Gnat systems?

There appears to be nothing relevant in POSIX.SUPPLEMENT_TO_ADA_IO
except the comments (in the Florist implementation) that this is a
terrible interface!

It seems that one needs a way of extracting a Posix File Descriptor
from a variable of the appropriate File_Type.  No doubt one can do
this on any particular implementation by poking around in the System
packages and using Unchecked Conversion.

BTW there is no intention of mixing Ada IO and POSIX IO on the same
open file -- I simply want to lock (portions of) the file before
updating it (preferably with Ada IO operations).

   Alan Barnes
   Computer Science              Telephone: +44 121 359 3611 Ext. 4663
   Aston University              E-Mail:  [log in to unmask]
   Aston Triangle                Fax:     +44 121 333 6215
   Birmingham B4 7ET             WWW:
   U. K.