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:
Mike Brenner <[log in to unmask]>
Reply To:
Mike Brenner <[log in to unmask]>
Date:
Fri, 15 Oct 1999 10:33:07 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (35 lines)
Wretling Urban> I want to execute the cp command on unix to copy a
file ...

Steve Deller > POSIX 1003.1a (I think that is the right update
letter) defines a C call for
> what you want, namely:   int system(const char *command)
> That invokes the system standard "sh" shell to run the "command" string...
> POSIX 1003.5 and 1003.5(b) (the latest I believe) were done against earlier
> versions of 1003.1 and thus do not have the system call in a standard Ada
> format ... For your application, just make a simple pragma interface C to the system
> call.  If you need more explanation than that, let me know.

Doing system calls in an operating system manner has always been
problematical for me. I would appreciate pointers to further
explanations of the following:

  (a) What if you want the csh instead of the sh?

  (b) Is there a chart where to download or purchase a Posix binding
for each Ada compiler?

  (c) Is there a chart that shows which calls are compatible between
Linux and NT 4.0 Service Pack 5?

  (d) Is there a chart that shows which calls are compatible between
Linux and Solaris 2.6?

  (e) Is there documentation showing (in the example of the cp
command) the difference between various possible error conditions
such as (1) the cp command does not exist, (2) the cp command was
available but privacy controls prevent executing it, (3) the cp
command failed due to problems with the source file (e.g. file not
found), (4) the cp command failed due to problems with the target
file (e.g. disk full).

ATOM RSS1 RSS2