[Tutor] Better way to check *nix remote file age?

Albert-Jan Roskam fomcl at yahoo.com
Thu Jun 26 20:40:43 CEST 2014


<snip>


> I'd probably rather try Paramiko's SFTPClient and retrieve the file

> modified date directly:
> http://paramiko-docs.readthedocs.org/en/latest/api/sftp.html#paramiko.sftp_client.SFTPClient
> (see the SFTPFile.stat() method in particular, which gives you back a
> stat object containing mtime, the modification datetime IIRC)
> 
> 2 more (hopefully) useful links if you decide to go this route:
> http://www.saltycrane.com/blog/2010/02/python-paramiko-notes/
> http://jessenoller.com/blog/2009/02/05/ssh-programming-with-paramiko-completely-different

Interesting. Question: what is the added value of paramiko compared to using subprocess to use ssh (ie, shell commands)? (Possible answer: it is platform-independent)

Regards,
Albert-Jan



More information about the Tutor mailing list