ka*****************@yahoo.ca said:
Greetings all.
I am trying to make a system call as on WinXP,
#include <stdlib.h>
int main()
{
system( "ls -al");
}
but it is doing nothing!!
Has anybody ever experienced such a thing!? My belief is there is a
library that was missed when I installed VC but I am not sure.
Any suggestions, hints, pointers etc etc is greatly appreciated.
Firstly, check that your system has an ls command that accepts the switch
-al. It is quite likely in your case that it does not, since ls isn't a
command normally associated with Windows systems.
Secondly, if your system does support an ls command, consider the
possibility that the system call is executing so quickly that you simply
don't see it. For example, consider doing something like:
system("ls -al > listing.txt");
and then checking for the existence of listing.txt.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)