gcs_mount {GCSFilesystem} | R Documentation |
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.
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 )
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. |
no return value
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) }