I’ve written a simple tool to synchronize a couple dozen files between a M$ Windows 11 NTFS volume and a directory inside a Debian container via SFTP using paramiko.
I’d like to use the file’s modified time stamp but I’ve run into the following problem.
With the same file on both local and remote -
The local file with Python 3.11 using os.stat() gives a st_mtime ==
Paramiko’s stat has st_mtime ==
This is AFTER I’ve tried doing
sftp.utime(remotepath, (local_stat.st_atime, local_stat.st_mtime,)) which should have synchronized the modified times but it hasn’t.
Is there something I am missing or perhaps maybe the sftp server doesn’t support overwriting file’s modified timestamp?
I am not stuck if there isn’t a work around, I can just keep a local ledger of what has been sent and when it was sent to the remote server but this seems like a weird problem that might have an easy fix.