我怎样才能知道,如果一个文件完成了通过FTP? [英] How can I tell if a file has finished being FTPed?

查看:114
本文介绍了我怎样才能知道,如果一个文件完成了通过FTP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个C#Windows服务轮询等待FTP'ed文件的文件夹中发布。为了避免使用文件时仍然被写入它,我们先尝试获取有关文件的锁,但是,有似乎场合,我们正在对文件锁在创建后的FTP'ed文件,但之前对文件进行写入,所以我们最终打开一个空文件。

We have a C# Windows service polling a folder waiting for an FTP’ed file to be posted in. To avoid using the file when it is still being written to we attempt to get a lock on the file first, however, there seems to be occasions where we are getting a lock on the file after the FTP’ed file is created but before the file is written to, so we end up opening an empty file.

是否有可靠的反正告诉如果FTP是完整的?

Is there a reliable anyway to tell if the FTP is complete?

推荐答案

怎么样使用文件夹的专家以指数内容,如果一个文件大小不5分钟之内改变你几乎可以-多少保证上传已经完成。

What about using a folder watcher to index the contents and if a files size does not change within 5 mins you can pretty-much guarantee the upload has been finished.

的时间了,可以连接到您的FTP服务器的超时时间。

The time out could be tied to the timeout of your FTP server to.

http://www.codeproject.com/KB/files/MonitorFolderActivity.aspx

这篇关于我怎样才能知道,如果一个文件完成了通过FTP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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