davidstrauss / google-drive-recursive-ownership

Tool to recursively give away file and document ownership to another user.
MIT License
268 stars 68 forks source link

Only recurses 1 level #25

Closed pklapperich closed 5 years ago

pklapperich commented 5 years ago

The script doesn't seem to crawl the entire directory structure but only changes ownership of the objects immediately within the shared folder.

Between this and the #19, it's hard to find usefulness in this script outside cases simple situations that are relatively quick to do manually via the web interface already.

davidstrauss commented 5 years ago

The script doesn't seem to crawl the entire directory structure but only changes ownership of the objects immediately within the shared folder.

That's incorrect. Recursion happens for any nested folder at any depth: https://github.com/davidstrauss/google-drive-recursive-ownership/blob/master/transfer.py#L112

Between this and the #19, it's hard to find usefulness in this script outside cases simple situations that are relatively quick to do manually via the web interface already.

Directory structures are preserved under many but not all circumstances. Much of this is a result of how Google Drive handles objects, which isn't like a normal file system. One of the characteristics is that a file cannot be in a folder for someone without being shared or owned by them, but sometimes changing the owner seems to put the object into the root of the destination user's Google Drive.

In general, it's a lot harder to move a hierarchy when the items (or at least folders) aren't already shared to the destination account. The script handles the sharing/ownership to the best ability of the API, which appears more limited than some of what the web app itself does, which offers recursive sharing (but not ownership changes) directly.

So, I believe you can work around the issue by pre-sharing. I'm not sure it's possible to solve in the script itself.

Nottt commented 5 years ago

@davidstrauss any chance we get some UTF8 love so we can use the script for non ASCII filenames?

davidstrauss commented 5 years ago

any chance we get some UTF8 love so we can use the script for non ASCII filenames?

Let's chat on #26, which I see you've created.