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=0.7 required=5.0 tests=BAYES_00,INVALID_MSGID, PDS_OTHER_BAD_TLD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a4c01e243163facf X-Google-Attributes: gid103376,public From: nasser@apldbio.com (Nasser Abbasi) Subject: Re: C File Descriptors in Ada95 Date: 1996/07/21 Message-ID: #1/1 X-Deja-AN: 169846780 sender: news@biosys.apldbio.COM references: <1996Jul19.225520.22396@nosc.mil> to: seibert@monkfish.nosc.mil (Jerome D. Seibert) original-sender: nasser@apldbio.com organization: Applied BioSystems newsgroups: comp.lang.ada Date: 1996-07-21T00:00:00+00:00 List-Id: From: seibert@monkfish.nosc.mil (Jerome D. Seibert) I have a need to make a call to a C function from an Ada-95 procedure, and pass an open file descriptor to the C function. I have tried extending Ada.Text_IO and passing File.Stream to my C routine and then dereferencing the pointer in the C code (this did not work). I then tried performing an unchecked conversion from System.Address to Integer'Access to convert File.Stream to an Integer access, dereference the access pointer and passing this to my C routine as a file descriptor (int) (this did not work either). Any info on how I might do this would be greatly appreciated. ...snip.. You might want'a look at at fattach() : NAME fattach - attach a STREAMS-based file descriptor to an object in the file system name space SYNOPSIS int fattach(int fildes, const char *path); MT-LEVEL MT-Safe DESCRIPTION The fattach() routine attaches a STREAMS-based file descrip- tor to an object in the file system name space, effectively associating a name with fildes. fildes must be a valid open file descriptor representing a STREAMS file. path is a path name of an existing object and the user must have appropri- ate privileges or be the owner of the file and have write permissions. All subsequent operations on path will operate on the STREAMS file until the STREAMS file is detached from the node. fildes can be attached to more than one path, that is, a stream can have several names associated with it. bye, Nasser -- Nasser Abbasi. C/C++/Ada Solaris. GeneAssist - A client/server application for Nucleic acid and protein sequence search and analysis. Perkin Elmer - Applied BioSystem division. email: nasser@apldbio.com MSEE(control), MSCS, MSCE, FM (Fide Chess Master).