splitbrain / ReMarkableAPI

Docs and implementation of the reMarkable file sync API
https://www.splitbrain.org/blog/2018-02/02_file_sync_for_remarkable_tablet
MIT License
374 stars 27 forks source link

Deleting root-node gives issues #12

Open Anonym-Bruker opened 5 years ago

Anonym-Bruker commented 5 years ago

When uploading a file with the command like this: remarkable.php upload /path1/path2/path3/filename.txt the script correctly creates all the directories path1->path2->path3 with the name inside path3. This worked excellent.

But then I tried to delete "path1" directly, without deleting the sub-directories. This delete is not "recursive", so the sub-directories seem to still exist, and then seems to lead to some corruption. When I tried to run the "remarkable.php list"-command, it gave an error message about wrong metadata (Don't remember the exact error message)

But if I deleted all the path2, path3 and the file inside path3, the list-command worked again, and it seems that I cleaned everything up.

=> Please consider one of two options:

  1. Don't allow to delete directories that are not empty
  2. Make the delete-command recursive to delete everything

Else, love the php-"app"!