This is a follow up question to this (write.csv permisson shiny server - R).
I am using a shiny app to search and save some data. I was having problems getting folder permission. After reading this (https://groups.google.com/forum/#!topic/shiny-discuss/srWETT6uL-I) I managed to solve by running this is RStudio server shell:
sudo chown shiny:shiny /path_to_app/path_to_data
However, this doesn't seem to work for me anymore. When I click my save data button in my app, I get the familiar error:
cannot open compressed file 'mutec/mutec_data.rds', probable reason 'Permission denied
So I read this (https://askubuntu.com/questions/528411/how-do-you-view-file-permissions) to try and find out the folder permissions. I get this:
Mutec_data$ ls -l ./mutec total 4 -rw-r--r-- 1 pdowns pdowns 446 Apr 17 12:22 mutec_data.rds
I'm struggling to interpret this. Does it mean that user pdowns can read and write? Should there be a "shiny" user with read and write permission?
This is my saveData function:
outputDir <- "mutec"
saveData <- function(data) {
# Write the file to the local system
saveRDS(
object = data,
file = file.path(outputDir, "mutec_data.rds")
)
}
Update
When I check the permissions of a folder that does let me write, I get this:
PPL040_baseline$ ls -l ./ctest total 4 -rw-rw-r-- 1 shiny shiny 105 Apr 8 06:45 Consumed.csv
Which must mean I didn't get this bit correct:
sudo chown shiny:shiny ...