# NOT RUN {
cont <- blob_container("https://mystorage.blob.core.windows.net/mycontainer", key="access_key")
list_blobs(cont)
upload_blob(cont, "~/bigfile.zip", dest="bigfile.zip")
download_blob(cont, "bigfile.zip", dest="~/bigfile_downloaded.zip")
delete_blob(cont, "bigfile.zip")
# uploading/downloading multiple files at once
multiupload_blob(cont, "/data/logfiles/*.zip", "/uploaded_data")
multiupload_blob(cont, "myproj/*") # no dest directory uploads to root
multidownload_blob(cont, "jan*.*", "/data/january")
# uploading serialized R objects via connections
json <- jsonlite::toJSON(iris, pretty=TRUE, auto_unbox=TRUE)
con <- textConnection(json)
upload_blob(cont, con, "iris.json")
rds <- serialize(iris, NULL)
con <- rawConnection(rds)
upload_blob(cont, con, "iris.rds")
# downloading files into memory: as a raw vector, and via a connection
rawvec <- download_blob(cont, "iris.json", NULL)
rawToChar(rawvec)
con <- rawConnection(raw(0), "r+")
download_blob(cont, "iris.rds", con)
unserialize(con)
# }
Run the code above in your browser using DataLab