gcs_dir: List bucket/folder/object

Description Usage Arguments Value Examples

View source: R/cloud-functions.R

Description

list objects in a bucket/folder or get the description of a file. You can change the current direction via '[[' or '$' operator. '..' can be used to go to the parent folder. For reducing the number of request sent to the network, it is recommended to add a trailing slash if the path is a folder.

Usage

1
gcs_dir(path, delimiter = TRUE, billing_project = gcs_get_requester_pays())

Arguments

path

The character path to a bucket/folder/file or a FolderClass/FileClass object returned by 'gcs_dir'.

delimiter

Logical(1), whether to use '/' as a path delimiter. If not, the path will be treated as the path to a file even when it ends with '/'

billing_project

logical(1) or character(1). If logical, whether users should pay the cost for accessing the data. The billing project is the project ID in 'gcs_get_billing_project()'. If character, it represents the project ID that will be charged by Google.

Value

'FolderClass' object or a 'FileClass' object

Examples

1
2
3
4
5
6
7
8
9
## List files in a bucket
## Equivalent: gcs_dir(path = "gs://genomics-public-data/")
gcs_dir(path = "genomics-public-data/")

## List files in a folder
gcs_dir(path = "genomics-public-data/clinvar/")

## List the information of a file
gcs_dir(path = "genomics-public-data/clinvar/README.txt")

GCSConnection documentation built on Nov. 8, 2020, 5:30 p.m.