googledrive (version 0.0.0.9000)

paths: Query paths.

Description

These functions query files that match one or more paths. The plural s of paths conveys whether you are allowed to provide more than one input path. Be aware that you can get more than one file back even when the input is a single path! Drive file and folder names need not be unique, even at a given level of the hierarchy. A file or folder can also have multiple parents. Note also that a folder is just a specific type of file on Drive.

Usage

drive_path_exists(path, verbose = TRUE)

drive_paths_exist(path, verbose = TRUE)

drive_path(path = "~/", verbose = TRUE)

drive_paths(path = "~/", verbose = TRUE)

Arguments

path

Character vector of path(s) to query. Use a trailing slash to indicate explicitly that the path is a folder, which can disambiguate if there is a file of the same name (yes this is possible on Drive!).

verbose

Logical, indicating whether to print informative messages (default TRUE).

Value

drive_path_exists(): a single TRUE or FALSE

drive_paths_exist(): Logical vector of same length as input

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

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

See Also

If you want to list the contents of a folder, use drive_ls(). For general searching, use drive_find().

Examples

Run this code
# NOT RUN {
## get info about your "My Drive" root folder
drive_path()
drive_path("~/")

## determine if path 'abc' exists and list matching paths
drive_path_exists("abc")
drive_path("abc")

## be more specific: consider only folder(s) that match 'abc'
drive_path_exists("abc/")
drive_path("abc/")

## limit to files with your My Drive root folder as direct parent
drive_path("~/def")

## use the plural forms to query multiple paths at once
drive_paths_exist(c("abc", "def"))
drive_paths(c("abc", "def"))
# }

Run the code above in your browser using DataLab