jcline / fuse-google-drive

A fuse filesystem wrapper for Google Drive.
GNU General Public License v2.0
285 stars 48 forks source link

Folders #9

Open jcline opened 12 years ago

jcline commented 12 years ago

My understanding is that Google Drive supports having multiple parent folders for a single file. Should we mimic this with soft or hard links?

If not, how do we handle this? Having the same file listed in each parent dir could cause issues if they do rm dir1/file, because then we need to make sure we remove it from every other directory or leave it in all of those and remove the reference from dir1

Source: https://plus.google.com/103354693083460731603/posts/h1jABDzXCqD

jcline commented 12 years ago

Hashed out in IRC that using hardlinks makes sense for this.

jcline commented 12 years ago

Additionally -- how should folders be represented internally?

I am thinking a tree of the form:

struct tree_t {
    // If this is NULL then this is a leaf node
    struct tree_t *children;
    // If this is NULL then we have no parent folders other than /
    struct tree_t *parents;
    // A link to the actual data for this file/folder
    struct gd_fs_entry_t *entry;
};

There may be a simpler way to do this, though.