简体   繁体   English

Linux execlp用C ++编写

[英]Linux execlp in C++

It is my first time with Linux, and I need to use this 这是我第一次使用Linux,我需要使用它

execlp("/usr/bin/wget", "wget", <URL STRING1>, NULL) system call in C++ code,

I cannot find anywhere how it should be written in C++, need some help. 我无法在任何地方找到它应该如何用C ++编写,需要一些帮助。

Thank you! 谢谢!

execl("/usr/bin/wget","wget","http://stackoverflow.com/",NULL);

应该做的工作。

Include the unistd.h 包括unistd.h

#include <unistd.h> 

int main() {
    execlp("/usr/bin/wget", "wget", "http://www.google.com", NULL);

    return 0;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM