本文介绍了使用C#增量扫描新的/修改的FTP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个FTP服务器,我需要从该FTP服务器将文件上传到Azure中的Blob存储.我无法触摸或移动任何文件.无论如何,是否有要进行增量扫描(通过id或类似方法),还是必须保存最新文件的修改日期,然后再扫描比该文件新的文件?欢迎所有输入.

I have an FTP server from which I need to upload files to a blob storage in Azure. I cannot touch or move any of the files. Is there anyway to do an incremental scan (through an id or similar), or do you have to save the modified date of the newest file and then scan all files newer than that? All input are welcome.

推荐答案

FTP所能做的就是获取目录中所有文件的列表.没什么.

All you can do with FTP is to get a list of all files in a directory. Nothing else.

某些FTP服务器将允许您检索按时间戳排序的列表.这是专有的非标准扩展.请参阅如何获取按修改时间排序的FTP文件夹中的文件.但这仍然不能免于您请求列出所有文件的列表(尽管一旦获得所需的所有文件,您可能会过早中止列表下载).

Some FTP servers will allow you retrieving the list sorted by a timestamp. This is a proprietary non-standard extension. See How to get files in FTP folder sorted by modification time. But it still won't save you from requesting a listing of all files (though you may abort the list download prematurely, once you get all files you need).

无论您如何定义,都无法要求FTP服务器仅返回新文件".

There's no way to ask an FTP server to return only "new files", no matter what's your definition of that.

如果需要任何花哨的内容,则必须在服务器( server 作为 machine ,而不是 server 作为服务器上)上构建服务 FTP服务器)本身,并具有可以满足您需要的API.

If you need anything fancy, you will have to build a service on the server (server as a machine, not server as an FTP server) itself with an API that will do what you need.

这篇关于使用C#增量扫描新的/修改的FTP文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 02:18