dcop 可以做哪些有趣的事情?
我使用 UNIX 已有多年,直到最近才注意到 dcop 命令。 它的主要目的是什么?在任何流程中使用它是否是糟糕设计的标志?
I have been using UNIX for years and the dcop command only recently came to my attention. What is its primary purpose and is using it in any process a sign of poor design?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可能不会,只要您使用 DCOP 执行某些通常通过鼠标单击或热键即可完成的任务。 这肯定比试图控制鼠标来完成你想要用程序做的事情更好的设计!
但是,如果您使用 DCOP 做一些非常简单的事情,可以直接使用 shell 命令或几行 C 代码来完成,而根本不需要调用 KDE 应用程序,那么直接做可能会更好。 (例如,不要使用 DCOP 告诉 Konqueror 删除目录树,只需运行 rm -rf)
Probably not, as long as you're using DCOP to perform some task that would ordinarily be done with a mouse click or hotkey. It's certainly way better design than trying to control the mouse to do what you want to do with the program!
But if you use DCOP to do something really simple that could be done directly with a shell command or a few lines of C code, without invoking a KDE application at all, it's probably better to just do it the direct way. (e.g. don't use DCOP to tell Konqueror to remove a directory tree, just run
rm -rf
)我怀疑它的存在主要是因为 UNIX 中的所有内容都应该可以从命令行访问。
I suspect it mainly exists because everything in UNIX ought to be accessible from the command line.
关于 dcop 的维基百科文章值得一读。
对于任何用于控制进程的脚本来说都很棒,在 通过 dcop 控制 Amarok。
The Wikipedia article on dcop is worth a read.
It's great for any scripts to use to control processes, there's also good information on controlling Amarok via dcop.