常见unix命令(特别是dd)的java库?
我需要使用 dd 命令来阻止某些文件,并且宁愿不通过 shell 调用它。
是否已经编写了类库,或者我应该推出自己的拦截器解锁器?
基本上相当于去:
dd if=foo.log of=fooblocked.log cbs=79 conv=block
I need to use the dd command for blocking some files, and would rather do it without calling it via shell.
Is there a class library already written, or should I roll my own blocker unblocker?
Basically equivalent to going:
dd if=foo.log of=fooblocked.log cbs=79 conv=block
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Runtime.getRuntime().exec() 执行在 shell(Windows 中的命令提示符)中传递的命令,shell 默认为程序工作目录。
如果您需要程序等待命令完成,可以使用
p.waitFor()
。Runtime.getRuntime().exec()
executes the command passed in a shell (a command prompt in Windows) the shell defaults to the programs working directory.If you need the program to wait until the command completes, you can use
p.waitFor()
.