gcs_mount: Mount a Google Cloud Storage(GCS) file system

Description Usage Arguments Value Examples

View source: R/gcs_mount.R

Description

The function uses the command-line program 'GCSDokan' on Windows or 'gcsfuse' on Linux system to mount a google cloud bucket path to your local file system.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
gcs_mount(
  remote,
  mountpoint,
  mode = c("r", "rw"),
  cache_type = c("disk", "memory", "none"),
  cache_arg = NULL,
  billing = NULL,
  refresh = 60,
  implicit_dirs = TRUE,
  key_file = NULL,
  additional_args = NULL
)

Arguments

remote

the remote path to a Google Cloud Storage bucket. It can be either the bucket itself or a directory in the bucket.

mountpoint

The mount point where the GCS file system will be mounted to.

mode

the permission of the mounted directory. The write permission is only available on Linux.

cache_type

The location where the file cache will be stored. The cache type 'none' and 'memory' are only available on Windows

cache_arg

The argument of a cache type. If 'cache_type = "memory"', the argument is the limit of the memory useage in MB. If 'cache_type = "disk"', the argument is the path to a cache directory.

billing

The billing project ID.

refresh

The refresh rate of the cloud files.

implicit_dirs

Implicitly define directories based on content. This argument is only available on Linux.

key_file

The service account credentials file

additional_args

The additional argument that will be passed to the command-line program.

Value

no return value

Examples

1
2
3
4
5
6
7
8
bucket <- "genomics-public-data"
mountpoint <- paste0(tempdir(),"/GCSFilesystemTest")
## You must have a credentials on Linux and macOs
## To run this code
if(Sys.getenv("GOOGLE_APPLICATION_CREDENTIALS")!=""){
    gcs_mount(bucket, mountpoint)
    gcs_unmount(mountpoint)
}

Example output



GCSFilesystem documentation built on Nov. 8, 2020, 7:50 p.m.