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,8dea6f46dfb95f66 X-Google-Attributes: gid103376,public From: geert@fozzie.sun3.iaf.nl (Geert Bosch) Subject: Re: Standard libraries (Was: Environment variables) Date: 1996/11/16 Message-ID: <56kocf$65k@fozzie.sun3.iaf.nl>#1/1 X-Deja-AN: 196949695 references: <55819q$mql@newslink.runet.edu> <327A32A3.2DD0@itg-sepg.logicon.com> <1996Nov2.173625.1@eisner> <55kmb1$3m6@top.mitre.org> <56do9g$1v5@fozzie.sun3.iaf.nl> organization: La Calandre Infortunee newsgroups: comp.lang.ada Date: 1996-11-16T00:00:00+00:00 List-Id: Robert Dewar wrote: "Can you please explain why the approved IEEE POSIX-Ada binding, which has this functionality, as well as all the other functionality you go on to describe in your note, does not EXACTLY meet this requirement, in EXACTLY the manner that you recommend? " As far as I have seen (looking at forest, I don't have the standard you mention as it is not public) this binding is very Unix specific and only meant for Unix systems. So rather than defining an interface that defines a consistent subset of the functionality most common platforms have, it takes one (Unix) and wraps a thin layer around the standard C library so it can be used in Ada. Instead of providing functions to set a file to read-only or read-write permissions, you can only set group, user and others access bits a-la Unix. If I want to write a cross-platform application that write-protects a file (for example during compilation) I want a way to specify that somehow. Having to use a group/owner/others set of permissions just doesn't make sense on other platforms. However it *does* make sense to write-protect a file in Unix, or to reset the rights to read/write. In the first case the Unix file mode is set like "chmod a-r" and in the second case file attributes are reset to the defaults as determined by the environment (UMASK in Unix). What I want is to have an interface that *increases* portability by specifying the common functionality of several major platforms. That way I know that I'm using a portable subset. If I need platform-specific features like sending a process a -SIGSTOP signal, then I could use the POSIX library. What does it mean to Unlink a file? The POSIX standard just is based on Unix implementation details like the Unix file-system using group/user/world permissions and i-nodes, It will be really hard to write a program using for example forest and not relying on a Unix implementation. Maybe I'm wrong and POSIX means Portable Operating System Interface for Computer Environments after all. But a comment in the Available Ada Bindings report from the AI&C tells more about the standard: "The POSIX program grew from the effort by Unix users to develop a "standard" definition of the Unix system interface. " I don't think it has grown much beyond that. There is a *huge* gap between the very clear, cross-platform standard Ada library that uses good Ada-style abstractions and the C-oriented Unix API put into an Ada coat. Don't get me wrong, I really like it that there is at least a good interface for Unix programs available, which maybe even might run on other systems using a Unix-emulation layer. Using the Unix API for writing programs that should also run in DOS however is abstraction inversion IMHO. You'll get a program that is barely readable and hard to maintain, because it relies very much on implementation details of Unix and the Unix-emulation layer. Regards, Geert -- E-Mail: geert@sun3.iaf.nl