Skip to content

Sometimes you need to check things about a dribble` or about the files it represents, such as:

  • Is it even a dribble?

  • Size: Does the dribble hold exactly one file? At least one file? No file?

  • File type: Is this file a folder?

  • File ownership and access: Is it mine? Published? Shared?

Usage

is_dribble(d)

no_file(d)

single_file(d)

some_files(d)

confirm_dribble(d)

confirm_single_file(d)

confirm_some_files(d)

is_folder(d)

is_shortcut(d)

is_folder_shortcut(d)

is_native(d)

is_parental(d)

is_mine(d)

is_shared_drive(d)

Arguments

d

A dribble.

Examples

## most of us have multiple files or folders on Google Drive
d <- drive_find()
is_dribble(d)
#> [1] TRUE
no_file(d)
#> [1] FALSE
single_file(d)
#> [1] FALSE
some_files(d)
#> [1] TRUE

# this will error
# confirm_single_file(d)

confirm_some_files(d)
#> # A dribble: 32 × 3
#>    name                       id                            drive_resource
#>    <chr>                      <drv_id>                      <list>        
#>  1 bravo                      1Z_I3bv1x0Fs0WZhZQ8p3-u-7mqf… <named list>  
#>  2 2021-09-16_r_logo.jpg      1dandXB0QZpjeGQq_56wTXKNwaqg… <named list>  
#>  3 2021-09-16_r_about.html    1XfCI_orH4oNUZh06C4w6vXtno-B… <named list>  
#>  4 2021-09-16_imdb_latin1.csv 163YPvqYmGuqQiEwEFLg2s1URq4E… <named list>  
#>  5 2021-09-16_chicken.txt     1axJz8GSmecSnaYBx0Sb3Gb-SXVa… <named list>  
#>  6 2021-09-16_chicken.pdf     14Hd6_VQAeEgcwBBJamc-FUlnXhp… <named list>  
#>  7 2021-09-16_chicken.jpg     1aslW1T-B8UKzAEotDWpmRFaMyMu… <named list>  
#>  8 2021-09-16_chicken.csv     1Mj--zJYZJSMKsNVjk2tYFef5LnC… <named list>  
#>  9 pqr                        143iq-CswFTwJTjVfKkcFMDW0jYq… <named list>  
#> 10 mno                        1gcUTnFbsF6uioJrLCsVQ78_F1wE… <named list>  
#> # … with 22 more rows
is_folder(d)
#>  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE
#> [12] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE
#> [23] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
is_mine(d)
#>  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [15] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#> [29] TRUE TRUE TRUE TRUE