-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssh2 does not set mtime/atime (scp_send64, setstat, fsetstat) #103
Comments
Btw.: Using python 3.8.2 on Ubuntu 20.04 |
Hey,
|
I just took a peek into the source code. I didn't find anything suspicious yet. |
I've never worked with cdef and the like.
and so on... |
I tried the following (with full paths though):
first print with local file says: ".bashrc 2019-07-08 08:10:56.616019" EDIT: I also tried it with relative paths (hard coded) with the same negative result |
I also tried the sftp_handle.fsetstat, but that also doesn't seem to work. |
Will try and reproduce in C when have some time, not high priority atm. |
With
|
Looks that I can't import the three attributes. Are you sure about the location "ssh2.sftp"? |
I tried the following first (using the sftp_handle):
This still doesn't work. EDIT:
|
Setting attributes individually from an OS stat works fine, Setting time with |
If you mean Python code, I might manage something tomorrow. What I meant to say earlier is that conn.setstat works while sftp_handle.fsetstat doesn't. |
The python code shown for Should be:
C code to reproduce scp behaviour would be great, so can debug and raise issue with libssh2, or python code to see if the issue is in ssh2-python or libssh2. |
Ah! I misplaced a flag! 😅 I'm not too familiar with C, but I'll see what I can do. |
My python code would look like this (time stamps are ignored though):
As for the C code... I didn't got to it, but this might help: https://github.com/libssh2/libssh2/blob/master/example/scp_write.c |
Anyways, I can confirm fsetstat and setstat working. The access and modification time is set correctly. There is a strange thing though... |
The Will try to reproduce in C, not very high priority atm. |
Documentation says:
But mtime and atime seem to be ignored. I tried copying from the examples, but it still won't work.
My authentication method is by the way userauth_password.
It did work with paramiko, so it shouldn't be an issue with the ssh server.
By the way: I would consider to work around this using setstat(path, attrs), but I'm not sure how I would have to create the SFTPAttributes object. It would be nice to have an example or more documentation on that.
The text was updated successfully, but these errors were encountered: