Both my systems show the very same permissions on the file.-rw-r--r--I have a script running in R that uses a basic R function download.file('http://www.sample-videos.com/csv/Sample-Spreadsheet-100-rows.csv', '/home/rstudio/xyz9', mode = a, quiet = FALSE)mode=a means append mode. I run the scrit on local system through Rstudio(IDE for R). It appends the files on my ubuntu system which is the local system. I run this script on server which is a centos through RStudio only and instead of appending data to the file, it completely overwrites the file.Is that a problem on system level or script level? permissions look just fine to me .When I run it on the server, I get the following on console:--2016-07-13 19:28:23--  http://www.sample-videos.com/csv/Sample-Spreadsheet-100-rows.csvResolving www.sample-videos.com... 52.74.31.185Connecting to www.sample-videos.com|52.74.31.185|:80... connected.HTTP request sent, awaiting response... 200 OKLength: unspecified [text/csv]Saving to: /home/rstudio/xyz9     0K ..........                                              267M=0s2016-07-13 19:28:24 (267 MB/s) - /home/rstudio/xyz9 saved [10998]When I run it on ubuntu, I get:trying URL 'http://www.sample-videos.com/csv/Sample-Spreadsheet-100-rows.csv'downloaded 10 KBWhat could be wrong here? I do really want the append mode to work on centos machine. Since I am running exactly the same script, I believe this has something to do with file permissions?Edit:As I see, Modified date is a little messed up on the centos machine. It's a server and hosted remotely. I see weird time stamp for split of a second when the file is updated. At 7:43, It shows modified date be :5:56 p.m (same date).When I run the download.file function, file size for a moment becomes 0 Kb.Modified date changed to correct time for a moment.After update, modified date changed to 6:40 p.m Time has been correctly set on the centos system.What seems not to work here?
append mode in Centos and Ubuntu
ubuntu;centos;r
There shouldn't be problem with permissions. You can write and read data, that's all, but program has to decide how to work with data inside a file. It looks like R, not system, problem to me.Anyway, outputs from server and local host are different. The one from server looks same like from wget. Check download.file.method which have to be set to internal (according to docs) - only this method support appending to file.