Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我执行 ANTexec任务运行rsync --progress /from/path/foo.txt to/path时,它会显示如下进度条: 32768 0% 0.00kB/s 0:00:00
exec
rsync --progress /from/path/foo.txt to/path
但永远不会更新它。
如果我在没有 ant 的情况下执行 rsync 命令,则会更新进度条。
任何指针将不胜感激。
这是预期的行为。
rsync 的输出刷新了同一行。例如,它可能会输出:
Precent finsihed: 0%\r Precent finsihed: 1%\r Precent finsihed: 2%\r
这样“完成百分比:”部分和百分比(“%”)将保持在屏幕上,而数字会发生变化。
但是,在 Java 中处理此类输出存在一些问题,请查看以下问题:
读取其他进程的无缓冲输出流
也许有一些方法可以处理这样的输出,但显然 Ant 没有实现它。