ArvadosFileR Documentation

ArvadosFile

Description

ArvadosFile class represents a file inside Arvados collection.

Usage

file = ArvadosFile$new(name)

Arguments

name

Name of the file.

Methods

getName()

Returns name of the file.

getRelativePath()

Returns file path relative to the root.

read(contentType = "raw", offset = 0, length = 0)

Read file content.

write(content, contentType = "text/html")

Write to file (override current content of the file).

connection(rw)

Get connection opened in "read" or "write" mode.

flush()

Write connections content to a file (override current content of the file).

remove(name)

Removes ArvadosFile or Subcollection specified by name from the subcollection.

getSizeInBytes()

Returns file size in bytes.

move(destination)

Moves file to a new location inside collection.

copy(destination)

Copies file to a new location inside collection.

Examples

## Not run: 
myFile <- ArvadosFile$new("myFile")

myFile$write("This is new file content")
fileContent <- myFile$read()
fileContent <- myFile$read("text")
fileContent <- myFile$read("raw", offset = 8, length = 4)

#Write a table:
arvConnection <- myFile$connection("w")
write.table(mytable, arvConnection)
arvadosFile$flush()

#Read a table:
arvConnection <- myFile$connection("r")
mytable <- read.table(arvConnection)

myFile$move("newFolder/myFile")
myFile$copy("newFolder/myFile")

## End(Not run)