comp.lang.ada
 help / color / mirror / Atom feed
* Passing a Command to Unix in Ada
@ 1999-02-06  0:00 Robert T. Sagris
  1999-02-07  0:00 ` Thomas Preymesser
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Robert T. Sagris @ 1999-02-06  0:00 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1999-02-19  0:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-06  0:00 Passing a Command to Unix in Ada Robert T. Sagris
1999-02-07  0:00 ` 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.

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