I am trying to write a script that saves a plot to drive; of course with plots, small tweaks are part & parcel of the job.
That means drive_upload() is probably inappropriate for my use case, though I'm accustomed to using it as my default go-to function so I'm most used to it.
Thus my journey to discovering drive_put():
- Use
drive_upload() [implicitly using the overwrite=NA default]. Oh crap, the re-run just created a new file with the same! Is there an overwrite parameter I should be using?
- Glance at
?drive_upload. Yes! OK Let's try overwrite=TRUE.
- Looks good! Let's share this file. [Add the right permissions]. Oh crap, the re-run creates a new drive ID... which means the permissions I so painstakingly added were lost! Is that expected behavior?
- [Actually read
overwrite carefully this time]. Oh, that's unfortunate... do I have to wait until the plot is finalized to set the permissions, then, to avoid this toil? That's unfortunate. Is it not possible to transfer the permissions over?
- [Check the Google Drive API... Check the {googledrive} issue tracker... Happen to see
drive_update() mentioned for the first time] Oh, I guess I should be using drive_update()... but what about the initial upload? Oh, ?drive_update() mentions drive_put().
I've only just now noticed that drive_put() is mentioned at the top of ?drive_upload, oops :)
All this to say, is there any downside to adding another mention of drive_update() and/or drive_put() under the description of overwrite?
|
#' * `TRUE`: Check for a pre-existing file at the filepath. If there is |
|
#' zero or one, move a pre-existing file to the trash, then carry on. Note |
|
#' that the new file does not inherit any properties from the old one, such |
|
#' as sharing or publishing settings. It will have a new file ID. An error is |
|
#' thrown if two or more pre-existing files are found. |
e.g.
...Note that the new file does not inherit any properties from the old one, such as sharing or publishing settings. It will have a new file ID. If you need to keep permissions and the file ID, use [drive_update()] or [drive_put()]. An error is thrown if two or more pre-existing files are found.
I am trying to write a script that saves a plot to drive; of course with plots, small tweaks are part & parcel of the job.
That means
drive_upload()is probably inappropriate for my use case, though I'm accustomed to using it as my default go-to function so I'm most used to it.Thus my journey to discovering
drive_put():drive_upload()[implicitly using theoverwrite=NAdefault]. Oh crap, the re-run just created a new file with the same! Is there anoverwriteparameter I should be using??drive_upload. Yes! OK Let's tryoverwrite=TRUE.overwritecarefully this time]. Oh, that's unfortunate... do I have to wait until the plot is finalized to set the permissions, then, to avoid this toil? That's unfortunate. Is it not possible to transfer the permissions over?drive_update()mentioned for the first time] Oh, I guess I should be usingdrive_update()... but what about the initial upload? Oh,?drive_update()mentionsdrive_put().I've only just now noticed that
drive_put()is mentioned at the top of?drive_upload, oops :)All this to say, is there any downside to adding another mention of
drive_update()and/ordrive_put()under the description ofoverwrite?googledrive/man-roxygen/overwrite.R
Lines 8 to 12 in 74a69a3
e.g.