FileManager can‘t write to Google Drive

Hi

I‘m trying to make a backup script for my iCloud drive. So I‘ve created bookmarks for all dirs there I want to backup, and for the iCloud.bak dir in my Google Drive. However, I can‘t write to this iCloud.bak:

var fm = FileManager.iCloud() // tried .local() too..
var dest = fm.bookmarkedPath("iCloud.bak")
console.log(dest)
fm.createDirectory(fm.joinPath(dest, "foo"))

-> 2019-05-29 11:09:50: /private/var/mobile/Containers/Shared/AppGroup/CED48F48-1C8F-4F5D-B958-799B5131A279/File Provider Storage/51135680/1vFbtsaW9kblItyjU1yGjCqIhBUDG1k1l/iCloud.bak
-> 2019-05-29 11:09:50: Error on line 28:19: Die Datei „foo“ konnte nicht im Ordner „iCloud.bak“ gesichert werden. // EN: The file foo couln‘t be saved to directory iCloud.bak

Or (same setup):

fm.copy(fm.bookmarkedPath("Scanbot"), fm.joinPath(dest, "Scanbot"))

-> 2019-05-29 11:21:39: Error on line 28:8: „Scanbot“ konnte nicht nach „iCloud.bak“ kopiert werden. // EN: Scanbot couldn‘t be copied to iCloud.bak

Did I do something wrong, or is is impossible to get writing access to 3rd party providers like GDrive?

1 Like

I get the same for Google Drive, works fine with iCloud, Dropbox I can’t create a bookmark (not all providers support it), and Working Copy works just fine.

On the basis it works with a 3d party storage provider, that suggests it is something specific to the Google Drive relationship.

I used a link to an IFTTT folder I have Google Drive for my test, and the interesting thing to note is that it isn’t being bookmarked as a folder, but instead as a file:

This could be an issue with Scriptable, but given Working Copy was just fine, and Google isn’t known for being iOS-standards heavy-weghts, my gut feel is that this might be the Google Drive provider offering things in an unusual way, whereby Scriptable sees it as a file (maybe a file referencing a folder?) rather than a folder?

Good catch. Didn’t see that, but for me too the Drive bookmark has a file icon. Same with Dropbox also, everything else works.

I’ll look into if this is an issue with Scriptable or Google Drive but I’m 99% sure that it’s a problem with Google Drive. Unfortunately, some apps doesn’t implement file providers “properly” which causes issues for other apps, especially when working with folders.

1 Like