Learn R Programming

AzureStor (version 1.0.0)

list_azure_files: Operations on a file share

Description

Upload, download, or delete a file; list files in a directory; create or delete directories.

Usage

list_azure_files(share, dir, info = c("all", "name"), prefix = NULL)

upload_azure_file(share, src, dest, blocksize = 2^24)

download_azure_file(share, src, dest, overwrite = FALSE)

delete_azure_file(share, file, confirm = TRUE)

create_azure_dir(share, dir)

delete_azure_dir(share, dir, confirm = TRUE)

Arguments

share

A file share object.

dir, file

A string naming a directory or file respectively.

info

Whether to return names only, or all information in a directory listing.

prefix

For list_azure_files, filters the result to return only files and directories whose name begins with this prefix.

src, dest

The source and destination filenames for uploading and downloading. Paths are allowed.

blocksize

The number of bytes to upload per HTTP(S) request.

overwrite

When downloading, whether to overwrite an existing destination file.

confirm

Whether to ask for confirmation on deleting a file or directory.

Value

For list_azure_files, if info="name", a vector of file/directory names. If info="all", a data frame giving the file size and whether each object is a file or directory.

See Also

file_share, az_storage

Examples

Run this code
# NOT RUN {
share <- file_share("https://mystorage.file.core.windows.net/myshare", key="access_key")

list_azure_files(share, "/")

create_azure_dir(share, "/newdir")

upload_azure_file(share, "~/bigfile.zip", dest="/newdir/bigfile.zip")
download_azure_file(share, "/newdir/bigfile.zip", dest="~/bigfile_downloaded.zip")

delete_azure_file(share, "/newdir/bigfile.zip")
delete_azure_dir(share, "/newdir")

# }

Run the code above in your browser using DataLab