Modified not inherited to the main dir
Hi :)
I don't know if this is the right category (maybe it's a problem of the android app). I uploaded an PDF to ownCloud 4.5.3 via android app in a low-lying directory. Only the modified of the top-directory was changed in to "today" but not the directory-modified one level up. Is this a bug or is this intended?
Greetings
@jancborchardt Can you please answer this? THX
Same problem in ownCloud 4.5.4
It’s not intended, good catch! The containing directory (also further levels up) should get the modified date propagated.
Maybe @icewind1991 knows how that would need to be done?
Is this happening only when uploading via external applications (android, iphone, desktop client, webdav in general)? Is the behavior the same when uploading via the web?
The change in mtime of the folders is done in the underlying filesystem, we don't change the mtime of the folder ourself
@DeepDiver1975 It's happening when uploading via web too. @icewind1991 I don't know If I correctly understand but if you can't change the mtime of up-lying filesystems in normal way, I have an idea. Changing the mtime is possible when you rename the folder in something different and rename it back immediately. Or maybe creat a dummy-file in every top-level and delet it immediately. It's not a neat solution but it should work...
I just tested this on my development environment. The mtine of the parent folders gets updated properly in the filesystem. But owncloud uses the mtime stored in the db. There, the parent folders mtime does not get updated when a file is written. When refreshing the filecache the file will have the correct mtime again. @icewind1991 Will you adress this in the new filecache?
It should already change the mtime of the folder when it's accessed again since it will detect that the folder has changed.
But that doesn't solve the main issue here that changes don't propagate up the filesystem three more then one step, and even the first step is only done if a file is created, renamed or removed. This is because the mtime of a folder is the mtime of the inode in the filesystem that lists the content of the folder. As far as I know this is the case on all operating system.
While it is possible to implement the mtime propagation inside ownCloud itself it's not as simple as it might seem. Only changing the mtime in the filecache can cause inconsistencies between the cache and the underlying file system. Changing the mtime of the underlying filesystem (using touch()) only works on the local filesystem and working around the touch() limitations on external file system would cause more overhead then I'm willing to have.
@icewind1991 the file size is already propagated up the tree - updating the mtime within this recursive function should do the job - right?
with sizes it doesn't give any issues since folders don't have a proper size in the first place so it doesn't have to change anything in the underlying filesystem.
Changing mtime in the cache but not on the underlying filesystem has a potential of breaking things
hmmm - but the underlying filesystem is only accessed via the ownCloud code. We can store the right mtime in the database and use only that one. Might that be a solution?
If we have to rely on the filesystem at this point maybe we simply have to state that we cannot fulfill this requirement.
hmmm - but the underlying filesystem is only accessed via the ownCloud code.
We have no way of knowing that, keep track of outside changes to the filesystem is hard enough as it is atm.
@icewind1991 isn't this now fixed in OC5?
I think it is.
Please reopen if this is still an issue with OC5