1

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.

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
Simen
  • 11
  • 1
  • EXIF is not the only metadata which may have a "content created" date stored. There's also [XMP](https://en.wikipedia.org/wiki/Extensible_Metadata_Platform) and [IPTC](https://en.wikipedia.org/wiki/International_Press_Telecommunications_Council#Photo_metadata), as well as file format specific metadata (JFIF, TIFF, PNG, GIF, QTFF, RIFF, PSD...). – AmigoJack Jun 02 '21 at 13:19
  • @AmigoJack Sure, but it does not change the question. All these are part of the file *contents*, right? – Martin Prikryl Jun 02 '21 at 13:48
  • @MartinPrikryl OP reduces his question to EXIF only and might not even be aware of others, especially when EXIF was not used but his data of interest is stored nonetheless. – AmigoJack Jun 02 '21 at 14:02

1 Answers1

0

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.

You cannot retrieve it without downloading the JPEG file. Or at least not without downloading the part of the file that contains the EXIF.


Related question: Check aspect ratio of image stored on an FTP server without downloading the file in Python

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992