Search code examples
rfileubunturstudiosamba

R in Ubuntu Server 14.04 - Writing file to a samba sharing in which a directory is protected by user/pass


I was wondering if writing to a protected samba directory, to a internal directory with another user/pass could be possible. I have been searching for an R package with these capabilities but I haven't found it yet. Now I'm using the write() function. In the documentation for this function, it says:

Arguments:

x : The data to be written out, usually an atomic vector.

file : A connection, or a character string naming the file to write to. If "", print to the standard output connection. If it is "|cmd", the output is piped to the command given by ‘cmd’.

I don't understand if the attribute "file" when writing "|cmd" launches the Terminal in Ubuntu server or something, but I can't make it work

Hope you have a nice day!


Solution

  • I found it can be done via a shell script in Ubuntu. The command is write(somefile, file = "|sh shellWriteSamba.sh")

    Edit: The complete solution is in R - write() a file to a SAMBA share