AlgorithmiaDataFile-class {algorithmia}R Documentation

DataFile object to interact with files. Supports Algorithmia data files, S3, Dropbox and more coming soon! To create one, call: 'client$file("file_path")'

Description

DataFile object to interact with files. Supports Algorithmia data files, S3, Dropbox and more coming soon! To create one, call: 'client$file("file_path")'

Fields

client

Reference to the AlgorithmiaClient object that has the credentials necessary to make API calls.

dataFileUrl

Url to access the file.

last_modified

A timestamp for the last modified time. Only gets set when setAttributes is called.

size

Size (in bytes) of the file. Only gets set when setAttributes is called.

Methods

delete()

Deletes the file.

exists()

Returns TRUE if this file exists. FALSE, if it does not.

getFile()

Copies the file to a tempfile and returns the path to that file.

getJson()

Returns the contents of the file after it has been JSON decoded.

getName()

Returns the name of the file without the parent directory path.

getRaw()

Returns the raw contents of the file.

getString()

Returns the contents of the file as a string.

put(data)

Writes the file with the current data passed in.

putFile(fileName)

Takes a local file path and writes its contents to this file.

putJson(data)

Encodes the data to a JSON object and writes that to the file.

setAttributes(attributes)

Sets the last_modified time and size (in bytes) of the file.


[Package algorithmia version 0.3.0 Index]