TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

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
Subject:
From:
Reply To:
Date:
Thu, 23 Nov 2000 09:51:07 GMT
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
Is there a PORTABLE way of using POSIX_5 file-locking with Ada files:

        Text_IO
        Sequential_IO
        Direct_IO

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:     http://www.cs.aston.ac.uk/~barnesa
   U. K.

ATOM RSS1 RSS2