-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osf_upload conflicts = "overwrite" doesn't seem to overwrite? #130
Comments
You're right that As to the error, could you check what version you're using? The following works for me with the current release (v0.2.8):
Created on 2020-08-25 by the reprex package (v0.3.0) |
I'm up to date with 0.2.8. You're absolutely right though, that reprex
works for me.
And it works in the root of my project. But it doesn't work in a
subdirectory, the use case I was trying but didn't document in my original
example. Try this reprex:
```
library(osfr)
project <- osf_create_project("test")
project %>% osf_mkdir("test_subdir")
project_subdir <- project %>%
osf_ls_files() %>%
filter(name == "test_subdir")
system("touch foo")
project_subdir %>% osf_upload("foo")
project_subdir %>% osf_upload("foo")
project_subdir %>% osf_upload("foo", conflicts = "overwrite")
```
… |
Thank you so much Aaron for the quick responses. I'm sorry I didn't catch
those earlier reports.
…On Thu, Aug 27, 2020 at 9:47 AM Aaron Wolen ***@***.***> wrote:
Thanks, that helps! Looks like you're the latest victim of this bug
<#121> which is now fixed
<#129> in the master branch. If you
install the latest dev version
remotes::install_github("ropensci/osfr")
you should be good to go—but please let me know if it doesn't work.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#130 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI25F6MF6TJT66CXSTMMXTSC2E3ZANCNFSM4QK6HNLA>
.
|
I'm not sure if I should open a new issue or not, but while the previous fix works find for regular sub directories, I have this problem on "sub sub" directories. Here is a reprex based on the last one, you can see that there are no problems with the sub directory, but the sub sub fails. library(osfr)
#> Automatically registered OSF personal access token
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
# SETUP
project <- osf_create_project("test")
project %>%
osf_mkdir("test_subdir") %>%
osf_mkdir("test_sub_subdir")
#> # A tibble: 1 x 3
#> name id meta
#> <chr> <chr> <list>
#> 1 test_sub_subdir 5fb6bd5f5502ac032c8c9199 <named list [3]>
project_subdir <- project %>%
osf_ls_files() %>%
filter(name == "test_subdir")
project_sub_subdir <- project %>%
osf_ls_files() %>%
filter(name == "test_subdir") %>%
osf_ls_files() %>%
filter(name == "test_sub_subdir")
system("touch foo")
# TESTING SUB DIRECTORY (No problems)
project_subdir %>% osf_upload("foo")
#> # A tibble: 1 x 3
#> name id meta
#> <chr> <chr> <list>
#> 1 foo 5fb6bd64def8eb0338e7b3c1 <named list [3]>
project_subdir %>% osf_upload("foo")
#> Error: Can't upload file 'foo'.
#> * A file with the same name already exists at the destination.
#> * Use the `conflicts` argument to avoid this error in the future.
project_subdir %>% osf_upload("foo", conflicts = "overwrite")
#> # A tibble: 1 x 3
#> name id meta
#> <chr> <chr> <list>
#> 1 foo 5fb6bd64def8eb0338e7b3c1 <named list [3]>
# TESTING SUB SUB DIRECTORY (409 error)
project_sub_subdir %>% osf_upload("foo")
#> # A tibble: 1 x 3
#> name id meta
#> <chr> <chr> <list>
#> 1 foo 5fb6bd6edef8eb0338e7b3df <named list [3]>
project_sub_subdir %>% osf_upload("foo")
#> Error: Cannot complete action: file or folder "foo" already exists in this location
#> HTTP status code 409.
project_sub_subdir %>% osf_upload("foo", conflicts = "overwrite")
#> Error: Cannot complete action: file or folder "foo" already exists in this location
#> HTTP status code 409. Created on 2020-11-19 by the reprex package (v0.3.0) |
I am now facing a different version of this issue: In the sub-subdirectory case, I do not get an error - instead, no conflicting files are found and the 'new' file is uploaded successfully - but then, the new version does not show up anywhere. Is there any workaround? |
Hi all, thanks for the osfr package!
I'm struggling a bit with the
osf_upload
function. In particular, the overwrite settings aren't working for me. Here's the relevant code. Here's a MWE (minus the specific project, but hopefully that's OK). A side note, the function documentation givesoverwrite = TRUE
in the example and that doesn't exist.Apologies if I'm missing something here!
The text was updated successfully, but these errors were encountered: