adls_open_to_raw: Create and write to a file.

Description Usage Arguments Value See Also Examples

Description

Create and write to a file.

Usage

1
2
3
4
5
6
adls_open_to_raw(adls, path, offset = NULL, length = NULL)

adls_open_to_text(adls, path, encoding = "UTF-8", offset = NULL,
  length = NULL)

adls_open_to_file(adls, path, path_local, offset = NULL, length = NULL)

Arguments

adls

adls S3 object, generated using adls().

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.

offset

numeric, the position of the starting-byte.

length

numeric, the number of bytes to be processed.

encoding

character, encoding to use.

path_local

character, path on local computer.

Value

adls_open_to_raw()

A raw vector.

adls_open_to_text()

A single character string.

adls_open_to_file()

A logical indicating success of the operation.

See Also

WebHDFS documentation for "Open and Read a File"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## 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"
  )

  # read file to a string
  adls_open_to_text(
    adls_example,
    path = "iris.csv"
  )

## End(Not run)

ijlyttle/AzureDatalakeStore documentation built on May 5, 2019, 5:56 p.m.