在Vala中执行系统命令 [英] Executing system command in Vala
本文介绍了在Vala中执行系统命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Vala中执行命令(例如ls),例如Python os.system函数,或者更好的是popen函数。知道吗?
I would like to execute a command (like ls) in Vala, like the Python os.system function, or, better, the popen function. Any idea ?
推荐答案
最好使用软件包 posix
。
然后,只需执行 Posix.system( command)
即可返回一个整数。
It's best to use the package posix
.
Then, just do Posix.system("command")
which returns an int.
< a href = http://www.valadoc.org/posix/Posix.system.html rel = noreferrer> http://www.valadoc.org/posix/Posix.system.html
这篇关于在Vala中执行系统命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文