当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R googledrive drive_trash 将云端硬盘文件移入或移出回收站


将云端硬盘文件移入或移出回收站

用法

drive_trash(file, verbose = deprecated())

drive_untrash(file, verbose = deprecated())

参数

file

识别您的 Google 云端硬盘上感兴趣的文件的内容。可以是名称/路径的字符向量、标有 as_id() 的文件 id 或 URL 的字符向量或 dribble

verbose

[Deprecated]这种对各个 googledrive 函数的逻辑论证已被弃用。要全局禁止 googledrive 消息传递,请使用options(googledrive_quiet = TRUE)(默认行为是发出信息性消息)。要以更有限的方式抑制消息传递,请使用帮助程序local_drive_quiet()或者with_drive_quiet().

dribble 类的对象,每个文件一行的 tibble。

例子

# 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: 1R83O27ymspvHp5R8iNDGR5x0jmcj7eSr>
drive_trash("chicken-trash.txt")
#> File trashed:
#> • chicken-trash.txt <id: 1R83O27ymspvHp5R8iNDGR5x0jmcj7eSr>

# Confirm it's in the trash
drive_find(trashed = TRUE)
#> # A dribble: 93 × 3
#>    name                 id                                drive_resource
#>    <chr>                <drv_id>                          <list>        
#>  1 chicken-trash.txt    1R83O27ymspvHp5R8iNDGR5x0jmcj7eSr <named list>  
#>  2 name-squatter-rename 1Ms5VnuZ0Zj6YwYH_--QRPn23S9mAK1-H <named list>  
#>  3 name-squatter-mv     1g5GU11l_To47XfVsCrG5myp__NF3NS1F <named list>  
#>  4 name-squatter-upload 1wtq4eiawMmjuKyxiqCxN6gWTU_iV0qhn <named list>  
#>  5 name-squatter-rename 1PIiHD7U_LUlvp8wJP7gqHnpoYYow-jc6 <named list>  
#>  6 name-squatter-mv     1hi9pfUDZfFIIlhQb4HKXwtJ8bM9H17pw <named list>  
#>  7 name-squatter-upload 1UVAF7m4aUlMyLw6MdFnqNKMimpF4TiHm <named list>  
#>  8 name-squatter-rename 1azGH1OEyLQPqlK_3x_AoXmlup4FOAqtL <named list>  
#>  9 name-squatter-mv     1ybTgSBYCCLEIewR16hm7lqt-uDJPknUD <named list>  
#> 10 name-squatter-upload 1CtvelVN6eMCkP30DXa8QRlyjs4p0a8lZ <named list>  
#> # ℹ 83 more rows

# Remove it from the trash and confirm
drive_untrash("chicken-trash.txt")
#> File untrashed:
#> • chicken-trash.txt <id: 1R83O27ymspvHp5R8iNDGR5x0jmcj7eSr>
drive_find(trashed = TRUE)
#> # A dribble: 92 × 3
#>    name                 id                                drive_resource
#>    <chr>                <drv_id>                          <list>        
#>  1 name-squatter-rename 1Ms5VnuZ0Zj6YwYH_--QRPn23S9mAK1-H <named list>  
#>  2 name-squatter-mv     1g5GU11l_To47XfVsCrG5myp__NF3NS1F <named list>  
#>  3 name-squatter-upload 1wtq4eiawMmjuKyxiqCxN6gWTU_iV0qhn <named list>  
#>  4 name-squatter-rename 1PIiHD7U_LUlvp8wJP7gqHnpoYYow-jc6 <named list>  
#>  5 name-squatter-mv     1hi9pfUDZfFIIlhQb4HKXwtJ8bM9H17pw <named list>  
#>  6 name-squatter-upload 1UVAF7m4aUlMyLw6MdFnqNKMimpF4TiHm <named list>  
#>  7 name-squatter-rename 1azGH1OEyLQPqlK_3x_AoXmlup4FOAqtL <named list>  
#>  8 name-squatter-mv     1ybTgSBYCCLEIewR16hm7lqt-uDJPknUD <named list>  
#>  9 name-squatter-upload 1CtvelVN6eMCkP30DXa8QRlyjs4p0a8lZ <named list>  
#> 10 name-squatter-rename 18sSfXc8w4I_34_jjzSUPxBWcALXWNTcR <named list>  
#> # ℹ 82 more rows

# Clean up
drive_rm("chicken-trash.txt")
#> File deleted:
#> • chicken-trash.txt <id: 1R83O27ymspvHp5R8iNDGR5x0jmcj7eSr>
源代码:R/drive_trash.R

相关用法


注:本文由纯净天空筛选整理自Jennifer Bryan等大神的英文原创作品 Move Drive files to or from trash。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。