[Owncloud] Is it possible for a file's parent storage to be different from its own storage?

Sarah Jones sarah.e.p.jones at gmail.com
Tue Apr 30 17:44:56 UTC 2013


On Mon, Apr 29, 2013 at 6:32 PM, Robin Appelman <icewind at owncloud.com>wrote:

> On Monday 29 April 2013 15:23:39 Sarah Jones wrote:
> > Hi,
> >
> > I'm looking at the code in core lib/files/cache.cache.php.
> >
> > For my app I need the storage string, and to cut everything before /data.
> >  I'm building a multiinstance owncloud app, so I cannot use "fileid" from
> > filecache between instances; I'm using the storage and path as a key
> > instead.
> > However, if the storage string is more than 64 chars, the storageid is
> > hashed, which makes this not possible.
> >
> > I can work around this for the current file, but I need it's parent's
> > storage as well.  Is it safe to assume that a child file and its parent
> > will always have the same storageid?
> >
> > Thanks,
> > ~Sarah Jones
>
> Using the cache alone it's not possible to get the parent storage, the
> cache
> holds no information about the context of a storage.
>
> You can get the parent storage using information from the mount
> configuration
> by getting the full path of a file (getPath on either \OC\Files\Filesystem
> or
> \OC\Files\View), get the parent path and resolve that back to the cache but
> this is not always unqiue, if the same storage is mounted in different
> places
> it has multiple parent paths, this is one of the reason why we don't
> storage
> that information in the cache.
>
>  - Robin Appelman
>

Hi Robin,

I'm not sure I understand your response.

This is my interpretation of the design: An entry in filecache has a
parent, which is the fileid for another entry in the filecache.  Each
filecache entry stores the storage numericId.  Using this information you
can get the parent storage id string, but it may be a hash if the storage
path was > 64 chars.

Are you saying that yes it is possible for the storage of the parent
filecache entry to be different from the storage of a filecache entry?  And
then the rest of your explanation is a suggestion of how I could get this
information since they may not be the same?

Thanks,
~Sarah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20130430/ea52e887/attachment.html>


More information about the Owncloud mailing list