[Owncloud] Help needed with Patch to set the mtime via webdav

Robin Appelman icewind at owncloud.com
Fri Feb 10 11:53:49 UTC 2012

On Friday 10 February 2012 11:40:24 Klaas Freitag wrote:
> Hi,
> I committed a patch today ( http://bit.ly/wVrb2u ) that allows to set
> the mtime of files with webDAV via propset, something we need to do
> proper syncing.
> I'd like to ask for help with a problem that the filesystem cache is not
> properly updated by this operation.
> I debuged that far:
> The mtime is correctly set in the file system.
> OC_FilesystemView has a method setFileMtime, which is implemented by
> calling basicOperation. This one fires a after_write signal, which is
> handled in the FileCache by method fileSystemWatcherWrite. From there it
> goes down to scanFile to update the data.
> In scanFile, the method stat is called on the view. This one does not
> the return the real new mtime from the file in the filesystem, but the
> one which is stored in DB.
> Robin, is it possible that the stat call takes the values from the cache
> instead of real stat'ing ? I am kind of lost in the redirections ;-)
> Thanks,
> Klaas

Perhaps the the mtime is retrieved from php's internal cache[1], getting the 
mtime from oc_filessytem wont take the value from the cache, the cache is only 
used explicitly.

Also, I think it would be better to call the added function to oc_filesystem 
'touch' to stay closer to that "normal" php api

[1]: http://php.net/manual/en/function.clearstatcache.php

 - Robin Appelman

More information about the Owncloud mailing list