Create and write to a file.

adls_create(adls, file, path, overwrite = FALSE, permission = NULL)

Arguments

adls

adls S3 object, generated using adls().

file

form_file S3 object, representing the "thing" to be uploaded. You can compose this using httr::upload_file() or curl::form_file().

path

character, remote path, defined with respect to root-path in adls$base_url. You may find file.path() to be useful to compose the path.

overwrite

logical, indicating if existing (remote) file is to be overwritten.

permission

integer (octal form), permission to assign to the object.

Value

A logical indicating success of the operation.

See also

WebHDFS documentation for "Open and Read a File"

Examples

not_run({ # create token (assumes Azure native app) token <- AzureOAuth::oauth_token_azure( tenant_id = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", application_id = "ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj", name = "foo" ) # create adls object with base-URL and token adls_example <- adls( base_url = adls_url("bar"), token = token ) # for this example, write a temporary file temp_file <- tempfile(fileext = ".csv") write.csv(iris, file = temp_file) # upload file adls_create( adls_example, file = httr::file_upload(temp_file), path = "iris.csv" ) })