當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。