LINUX:如何检测 ftp 文件上传完成 [英] LINUX: how to detect that ftp file upload is finished

查看:106
本文介绍了LINUX:如何检测 ftp 文件上传完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我有一个文件上传功能.文件通过 FTP 上传.我需要配置一个侦听器,它将检查新文件并仅在文件上传完成时调用脚本.因为如果我在检测到新文件后立即运行此脚本,它可以开始处理未完全上传的文件,这将导致错误.谁能告诉这在 LINUX 上是否可行,我该怎么做?

In my project I have a file uploading feature. Files are uploaded via FTP. I need to configure a listener that will check for new files and invoke a script only when file uploading is finished. Because if I run this script immediately after detecting the new file, it can start to process file that is not completely uploaded, which will cause an error. Can anybody tell if this is possible on LINUX and how can I do this?

推荐答案

我会尝试使用 inotify,事件代码 IN_CLOSE_WRITE.

I'd try using inotify, event code IN_CLOSE_WRITE.

这篇关于LINUX:如何检测 ftp 文件上传完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆