Christian Metscher
Christian Metscher
Btw.: Using python 3.8.2 on Ubuntu 20.04
I just took a peek into the source code. I didn't find anything suspicious yet. Looking at the manpage, it should be working... No issues reported on the GitHub project...
I've never worked with cdef and the like. The function definitions look like I could simply do things like ``` fileinfo = stat(path_to_file) attrs = SFTPAttributes() attrs.mtime(fileinfo.st_mtime) ``` and so...
I tried the following (with full paths though): ``` fifo = stat(".bashrc") attr = SFTPAttributes() attr.filesize = fifo.st_size print(".bashrc", datetime.fromtimestamp(fifo.st_mtime)) attr.atime = fifo.st_atime attr.mtime = fifo.st_mtime attr.permissions = fifo.st_mode attr.gid...
I also tried the sftp_handle.fsetstat, but that also doesn't seem to work. Just in case, I also used a vm with mx linux using python 3.7, but it's also not...
Looks that I can't import the three attributes. Are you sure about the location "ssh2.sftp"? EDIT: The import shows an error, but it does compile. Testing right now.
I tried the following first (using the sftp_handle): ``` attr = SFTPAttributes(os_stat) attr.flags = LIBSSH2_SFTP_ATTR_UIDGID | LIBSSH2_SFTP_ATTR_PERMISSIONS | LIBSSH2_SFTP_ATTR_PERMISSIONS attr.atime = os_stat.st_atime attr.mtime = os_stat.st_mtime attr.permissions = os_stat.st_mode attr.gid =...
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.
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): ``` finfo = stat(file) chan = conn.session.scp_send64( "%s/%s" % (destination, basename(file)), finfo.st_mode & 0o777, finfo.st_size, finfo.st_mtime, finfo.st_atime) with...