有没有办法在 Perl 脚本中使用 move 函数获取文件传输的进度?
我是一名 ETL 开发人员,需要处理大量数据,这些数据需要从一种表单处理为另一种表单,然后才能加载到表中。 因此,我使用的大多数脚本在某些时候都必须将文件从一个位置移动到另一个位置。 我们是一家橱窗店。 我想知道当我在 Perl 中使用 move 函数时是否有办法查看移动需要多长时间。 如果我需要通过系统调用一个Windows命令来给我这个选项,那么我也可以使用它。 Perl 或 Windows 命令行中是否有任何内容可以告诉我文件传输的进度?
谢谢!
I am an ETL developer and I deal with a lot of data that needs to be processed from one form to the other before it can be loaded into tables. Therefore, most of the scripts that I work with, at some point, have to move a file from one place to the other. We are a windows shop. I was wondering if there was a way to see how much time a move takes when I am using the move function in Perl. If I need to call a windows command through system that will give me this option, then I am ok to use that as well. Is there anything in Perl or windows command line that will tell me the progress of the file transfer?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Win32::FileOp 包来自cpan。
这是相关摘录:
命令行替代方案是 术语: :ProgressBar,它也更加灵活,但设置起来有些困难。 您必须执行以下操作:获取原始文件的大小,然后启动复制并轮询新文件的大小(从子进程)以更新进度栏。
You can use the Win32::FileOp package from cpan.
Here's a relevant excerpt:
A command line alternative would be Term::ProgressBar, which is also a lot more flexible, but somewhat harder to set up. You would have to do something like: get the original file's size, then start the copy and poll the new file's size (from a child process) to give updates to the progress bar.