从 SFTP 服务器读取图像 EXIF 数据,无需下载文件
我正在编写一个从 SFTP 服务器下载文件的脚本.但是,每个文件夹中有 10k 个文件(每个文件约 5MB),我只想下载相隔 12 小时的文件.(例如,12:00 时间和 00:00).
I'm writing a script that downloads files from a SFTP server. However, there are 10k files (~5MB per file) in each folder, and I only want to download files that are, say, 12 hours apart. (eg. 12:00 time and 00:00).
但我似乎只能读取上次修改的日期,而不是创建日期.这个日期似乎是隐藏的,直到我在本地拥有该文件.我有一个替代策略,但不如在第一次下载时获得正确的文件那么干净.
But I seem to only be able to read the date for last modification, not creation. This date seems hidden until I have the file locally. I have an alternative strategy, but it is not as clean as getting the right files on the first download.
JPEG EXIF 元数据是文件内容的一部分,而不是文件元数据的一部分,就文件系统/FTP 而言.所以它不是目录列表的一部分,至少我知道的任何 SFTP 服务器都不是.
JPEG EXIF metadata is part of the file contents, not part of file metadata, as far as filesystem/FTP is concerned. So it's not a part of a directory listing, at least not with any SFTP server I know of.
如果不下载 JPEG 文件,您将无法检索它.或者至少不下载包含 EXIF 的文件部分.
You cannot retrieve it without downloading the JPEG file. Or at least not without downloading the part of the file that contains the EXIF.