Opal has an internal file system that is accessible through web services. The Opal R package exposes files management related functions:
Setup the connection with Opal:
Download a file:
Download a file, protected by a password:
Upload the file at another location:
Create a folder and list folder content:
fooDir <- paste0("/projects/CNSIM/foo-", sample(10000:99999, 1))
opal.file_mkdir(o, fooDir)
opal.file_ls(o, "/projects/CNSIM")
Move file to the new folder and list folder content:
Rename the new folder and list folder content:
barDir <- paste0("/projects/CNSIM/bar-", sample(10000:99999, 1))
opal.file_mv(o, fooDir, barDir)
opal.file_ls(o, "/projects/CNSIM")
Extract the content of the archive file into a folder:
Write a file from the Opal file system into the R server session workspace:
Read back the file into the Opal file system:
Remove created folder and list folder content:
Good practice is to free server resources by sending a logout request: