-
Notifications
You must be signed in to change notification settings - Fork 1
Sub-directory support #6
Comments
Libstorj output:
It looks like the way Libstorj handles folders (with |
This issue exists because currently there is no sub-directory support in Goobox. Let's use this issue to track the implementation of such support. I prefer to work on this topic after implementing the two-sync without any sub-directory support. The two-way sync is a complex topic and it would be better first to have a stable implementation of the simpler use caset. |
I've given a bit of thought to this. So as i see it Storj doesn't support a file structure as of yet. FileZilla just adds the folder and sub-folder names in the name of the file. The issue is what if i take a file from Goobox and drag it into a another sub-folder in my sync folder, how are we going to make this change clear to other devices on the network that run the same sync folder?. Storj doesn't allow renaming of files, so if we would want to make this change visible to other machines running the same sync folder we would have to delete the file and upload it again with the new name which is a huge waste of bandwidth. As i see it the only way to make this directory structure visible across different devices that run the same Goobox sync folder is to not only sync the files across multiple devices, but also sync the Goobox database across multiple devices. So say i change a file on machine (A), i drag a file into a another folder within the sync folder. The database changes as the paths of the files are now different. This triggers a sync event that uploads the database with the new paths to the storj bucket. The clients on all machines closely monitor if this database file is changed or not. If it is, they (e.g. machine B) download the file and check for the differences in file structure and file naming (because some users might just rename the file). The files are then adjusted accordingly to what's in the sync folder. |
Implementing the sub-directory support like in FileZilla is enough of a workaround. Yes, moving and renaming files and folder would involve wasteful file transfer. The idea of synchronizing meta information between the devices is interesting, but it is actually a very serious and complex workaround. Perhaps, we may do it if no other option is available. Until then I recommend to push the discussion here: storj-archived/sips#19 |
BTW, if the rename feature is implemented in the Bridge in a way that the file id does not change, it should be possible to avoid the superfluous file transfer without synchronizing the database between devices. We already keep track of the file id in the sync db. If the file name changes, but the id stays the same, it should be possible for the device to detect this by comparing the current state of the bridge with the one in the sync db. In such case, the sync app will just move and rename file and folders without doing any file transfer. |
Ok, lets do the filezilla way for now. Is there a bridge feature request issue open for this?., if not please open one. |
@jkawamoto, would implementig file renaming on the bridge side be solved with a simple PR? |
Libstorj: storj-archived/libstorj#398 |
I proposed a simple solution but it was rejected because they have their plan. Currently, a file ID is a hash of the bucket name + the file name. To support renaming without changing file IDs, another database design is needed. I think that it is under discussion. |
Some additional observations on how sub-directory support is implemented in FileZilla. If a new empty directory is created, a new file is uploaded to Storj with:
This file entry is only useful for representing empty directories. If the above file entry is deleted, but there is another file entry with name |
This occurs when i create a sub-directory in FileZilla, add some files to it and then try to sync it with goobox:
The text was updated successfully, but these errors were encountered: