Move Drive files to or from trash

Usage,
drive_trash(file, verbose = deprecated())

drive_untrash(file, verbose = deprecated())

Arguments

file

Something that identifies the file(s) of interest on your Google Drive. Can be a character vector of names/paths, a character vector of file ids or URLs marked with as_id(), or a dribble.

verbose

[Deprecated] This logical argument to individual googledrive functions is deprecated. To globally suppress googledrive messaging, use options(googledrive_quiet = TRUE) (the default behaviour is to emit informational messages). To suppress messaging in a more limited way, use the helpers local_drive_quiet() or with_drive_quiet().

Value

An object of class dribble, a tibble with one row per file.

Examples

# Create a file and put it in the trash.
file <- drive_example_remote("chicken.txt") %>%
  drive_cp("chicken-trash.txt")
#> Original file:
#>chicken.txt <id: 1wOLeWVRkTb6lDmLRiOhg9iKM7DlN762Y>
#> Copied to file:
#>chicken-trash.txt <id: 1pG01tYBEJjrqZrwbzPKznGWYsRZIqBtn>
drive_trash("chicken-trash.txt")
#> File trashed:
#>chicken-trash.txt <id: 1pG01tYBEJjrqZrwbzPKznGWYsRZIqBtn>

# Confirm it's in the trash
drive_find(trashed = TRUE)
#> # A dribble: 90 × 3
#>    name                 id                                drive_resource   
#>    <chr>                <drv_id>                          <list>           
#>  1 chicken-trash.txt    1pG01tYBEJjrqZrwbzPKznGWYsRZIqBtn <named list [40]>
#>  2 name-squatter-rename 10d0zK8RjQB78MMcrARPPSPdtjwOTjLQ3 <named list [39]>
#>  3 name-squatter-mv     17W1TPu0C0KDUel420HeH6wcUJJsnKpcd <named list [39]>
#>  4 name-squatter-upload 1rEGaCGxZxkphNY9J6XUaSQfPNIu2fZVh <named list [39]>
#>  5 name-squatter-rename 1XueHVNUkCkFQ2X9q9xyrCscJPs2-THYL <named list [39]>
#>  6 name-squatter-mv     1p5Vr26vHK86e26Zj3J8zFrS6IbxUSbRW <named list [39]>
#>  7 name-squatter-upload 1YKu9R-8TZP7W0wDOTzJHi1BJZsdS_fWf <named list [39]>
#>  8 name-squatter-rename 1PKQRDdGePbv3DlrnqcXNW5CY0lYdFQvJ <named list [39]>
#>  9 name-squatter-mv     1jpl1mlKsjB2BXvfAK1G05byyVUtLpOWD <named list [39]>
#> 10 name-squatter-upload 17sVOMK6VVAM1YrxBFa7m08AhtyusfOOU <named list [39]>
#> # … with 80 more rows

# Remove it from the trash and confirm
drive_untrash("chicken-trash.txt")
#> File untrashed:
#>chicken-trash.txt <id: 1pG01tYBEJjrqZrwbzPKznGWYsRZIqBtn>
drive_find(trashed = TRUE)
#> # A dribble: 89 × 3
#>    name                 id                                drive_resource   
#>    <chr>                <drv_id>                          <list>           
#>  1 name-squatter-rename 10d0zK8RjQB78MMcrARPPSPdtjwOTjLQ3 <named list [39]>
#>  2 name-squatter-mv     17W1TPu0C0KDUel420HeH6wcUJJsnKpcd <named list [39]>
#>  3 name-squatter-upload 1rEGaCGxZxkphNY9J6XUaSQfPNIu2fZVh <named list [39]>
#>  4 name-squatter-rename 1XueHVNUkCkFQ2X9q9xyrCscJPs2-THYL <named list [39]>
#>  5 name-squatter-mv     1p5Vr26vHK86e26Zj3J8zFrS6IbxUSbRW <named list [39]>
#>  6 name-squatter-upload 1YKu9R-8TZP7W0wDOTzJHi1BJZsdS_fWf <named list [39]>
#>  7 name-squatter-rename 1PKQRDdGePbv3DlrnqcXNW5CY0lYdFQvJ <named list [39]>
#>  8 name-squatter-mv     1jpl1mlKsjB2BXvfAK1G05byyVUtLpOWD <named list [39]>
#>  9 name-squatter-upload 17sVOMK6VVAM1YrxBFa7m08AhtyusfOOU <named list [39]>
#> 10 name-squatter-rename 1aarnobNyvHba-LzAQh6vLA8ejS5oRoug <named list [39]>
#> # … with 79 more rows

# Clean up
drive_rm("chicken-trash.txt")
#> File deleted:
#>chicken-trash.txt <id: 1pG01tYBEJjrqZrwbzPKznGWYsRZIqBtn>