GNOME Bugzilla – Bug 559586
Support for setting attributes
Last modified: 2018-09-21 16:30:16 UTC
This is a tracker bug. We want to have support for setting attributes in most common backends. This means setting file timestamps and Unix modes where applicable. - DAV: no support atm, not sure if it's possible, would be nice to have it (WebDav is used for gnome-user-share) - FTP: no support atm, use SITE UTIME and SITE CHMOD, not easy as argument format is not standartized - SFTP: supports setting Unix mode, lacks timestamps - SMB: no support atm
SFTP support is subject to patch in bug 527339.
SMB backend has now support for setting mtime (commit #2086 in trunk). The atime value is set to atime = mtime at the moment - we would need to do stat() to retrieve the second attribute as we're setting them both at the same time. Too expensive (and mostly useless) unless somebody really needs that. Also, the code now has support for setting Unix modes however doing this might be confusing for users as there's no way to retrieve real file mode back in libsmbclient.
Ah it seems I found the correct upstream bug number, that Tomas alluded to on the redhat bug tracker... :) I still see this issue with gvfs 1.1.6 on Ubuntu 9.04 alpha5: $ touch -d "Dec 25 2004" blah touch: setting times of `blah': Operation not supported
(In reply to comment #3) > $ touch -d "Dec 25 2004" blah > touch: setting times of `blah': Operation not supported There was a bug in gvfs-fuse-daemon, fixed in commit 59bea4126cf23c575323c59a4cb1123f7cb44e2b. You should be able to touch the file on smb mounts now. Please note that smbclient reports success even if it actually fails, so don't be surprised.
Anyone considering implementing this for WebDAV?
For WebDAV, I've been giving it a try; see also #654679. Querying WebDAV properties works fine, for setting I'm getting weird corruption issues (random binary strings as result of query_{writable_namespaces,settable_attributes}, "Message Corrupt" when calling set_attributes_from_info()). Since no existing gvfs backend really supports this functionality yet (the extended attributes stuff is in glib/gio, not gvfs), I'm having a hard time figuring out whether my code is to blame or something else is going wrong (e.g. due to the ongoing transition to Gnome 3 in Debian). If anyone wants to give it a try, I can publish the WIP patches.
Unable to set attributes on Samba/CIFS .gvfs share with cp -pr. This bug exists in Fedora (gvfs-1.14.2-2.fc18, https://bugzilla.redhat.com/show_bug.cgi?id=461505), Gentoo (gnome-base/gvfs-1.12.3) and Ubuntu (gvfs-libs 1.12.1-0ubuntu1.1, https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/336761) and has long time history.
I can confirm this: (fuse-sshfs mounted directory) $ touch test touch: setting times of ‘test’: Operation not supported $ touch -d "Dec 25 2004" test touch: setting times of ‘test’: Operation not supported gvfs version 1.16.1
Confirmed for WebDAV - awilliam@linux-86wr:/run/user/1000/gvfs/dav:host=127.0.0.1,port=8080,ssl=false,user=adam,prefix=%2Fdav/Projects/General Documents/Documents/Watermarks> touch Draft.pdf touch: cannot touch ‘Draft.pdf’: Operation not supported - gvfs-1.20.2-1.1.x86_64
(In reply to comment #9) > Confirmed for WebDAV > - > awilliam@linux-86wr:/run/user/1000/gvfs/dav:host=127.0.0.1,port=8080,ssl=false,user=adam,prefix=%2Fdav/Projects/General > Documents/Documents/Watermarks> touch Draft.pdf > touch: cannot touch ‘Draft.pdf’: Operation not supported > - > gvfs-1.20.2-1.1.x86_64 AFAIK, there's no support for setting the mtime with webdav so this can never be supported.
OwnCloud at least permits setting mtime - so it depends on the server. Any the server I maintain does as well [OpenGroupware Coils]. The ability to set mtime is critical for file-sync type setups.
Sascha Silbe, did you do any more work related to WebDAV properties? If so do you have a patch I can play with?
There are some unfinished patches from Sascha in Bug 654679.
I'm afraid other than the patches attached to Bug 654679 there has been no further work on this from my side. I do not intend to work on this in the foreseeable future either. Feel free to pick up all or parts of the existing patches if they're of any help.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/70.