D - D system call
- Andrew Edwards (8/8) Jul 06 2003 I have a program I would like to execute from within another! How would ...
- Dario (7/15) Jul 06 2003 try this:
- Andrew Edwards (5/13) Jul 07 2003 Thanks, that does the trick!
- Dario (4/16) Jul 08 2003 Phobos has no function to execute programs actually.
-
Sean L. Palmer
(9/27)
Jul 08 2003
In C world this function would be in
, not , but perh...
I have a program I would like to execute from within another! How would I accomplish this in D? Here's the equivalent code in C++: #include <cstdlib> int main() { std::system("some_program"); }
Jul 06 2003
try this: extern(C) int system(char*); int main() { system("some_program"); return 0; }I have a program I would like to execute from within another! How would I accomplish this in D? Here's the equivalent code in C++: #include <cstdlib> int main() { std::system("some_program"); }
Jul 06 2003
"Dario" <Dario_member pathlink.com> wrote...try this: extern(C) int system(char*); int main() { system("dmd -O scopy"); system("scopy2.d"); return 0; }Thanks, that does the trick! However, since I'd much rather speak my native tongue! Is there a way to say this natively in "D"? Andrew
Jul 07 2003
try this: extern(C) int system(char*); int main() { system("dmd -O scopy"); system("scopy2.d"); return 0; }Thanks, that does the trick! However, since I'd much rather speak my native tongue! Is there a way to say this natively in "D"? AndrewPhobos has no function to execute programs actually. I'd like file.d to provide an execute() function beside read() and write(). Anyway, if you don't want to use the C standard library and you're running Windows you can use CreateProcess instead, but using it is very awkward.
Jul 08 2003
In C world this function would be in <process.h>, not <file.h>, but perhaps execute() could alternatively take a file object instead of a pathname. It's pretty important to have this; depending on the OS command line syntax makes you system dependant. Sean "Dario" <Dario_member pathlink.com> wrote in message news:bee9ja$2mu8$1 digitaldaemon.com...saytry this: extern(C) int system(char*); int main() { system("dmd -O scopy"); system("scopy2.d"); return 0; }Thanks, that does the trick! However, since I'd much rather speak my native tongue! Is there a way towrite().this natively in "D"? AndrewPhobos has no function to execute programs actually. I'd like file.d to provide an execute() function beside read() andAnyway, if you don't want to use the C standard library and you're running Windows you can use CreateProcess instead, but using it is very awkward.
Jul 08 2003