comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert T. Sagris" <robs@physics.BLAH.purdue.BLAH.edu>
Subject: Passing a Command to Unix in Ada
Date: 1999/02/06
Date: 1999-02-06T21:20:35+00:00	[thread overview]
Message-ID: <36BCB222.EF9B4FF7@physics.BLAH.purdue.BLAH.edu> (raw)

I was wondering if there are any functions similar to the system 
command in C available in Ada. Also I was wondering if there was 
a similar function as rename in Ada.

If you could give a translation for the following lines it would be
most appreciated. *THIS IS NOT HOMEWORK* I am trying to rewrite a little
program I wrote in C to Ada but don't no were to look. I have looked
through Ada, as a Second Language by Cohen and found nothing
useful for this problem

Well here are the lines.

/*The Header files for the functions*/
#include <stdio.h>
#include <stdlib.h>

main() {
...

/* In particular how would I cobble together some arbitrary string
   made up of string and integer variables. */
sprintf(command, "ls *%i.%s", some_integer, some_string);

/* Is there some equivalent command available in Ada's standard
   packages? */
system(command);

/* I know of the file handling functions in Ada.Text_IO such as
   Create, Open, Close, Delete etc.. but no Rename. (Is there on?)
*/
rename(old_file_name_string, new_file_name_string);

}

Well I hope this doesn't seem to simplistic but I found if I am
to general in my questions I get answer that assume I know more
about programming in Ada than I do.

Well thanks for any help you can give me.

Robbi Sagris




             reply	other threads:[~1999-02-06  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-06  0:00 Robert T. Sagris [this message]
1999-02-07  0:00 ` Passing a Command to Unix in Ada Thomas Preymesser
1999-02-08  0:00 ` dennison
1999-02-09  0:00   ` Robert T. Sagris
1999-02-09  0:00     ` dennison
1999-02-09  0:00     ` dennison
1999-02-09  0:00       ` Larry Kilgallen
1999-02-13  0:00         ` Lieven Marchand
1999-02-19  0:00     ` Steven Hovater
1999-02-19  0:00       ` robert_dewar
1999-02-09  0:00 ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox