[R-sig-DB] dbWriteTable permission problem on Mac OSX
Neil Tiffin
ne||t @end|ng |rom ne||t||||n@com
Thu Nov 5 18:43:37 CET 2009
On Nov 5, 2009, at 9:55 AM, Dirk Eddelbuettel wrote:
>
> On 5 November 2009 at 10:45, McGehee, Robert wrote:
> | My /tmp directory also has a sticky bit.
> |
> | Here's my guess of the problem. This chunk of code from the
> | 'dbWriteTable' method 'postgresqlWriteTable' specifies different
> | directories for Linux and non-Linux (e.g. Mac) tempfiles.
> | if(as.character(Sys.info()["sysname"])=="Linux")
> | fn <- tempfile("rsdbi","/tmp")
> | else
> | fn <- tempfile("rsdbi")
>
> Spot on! Sameer added this on my recommendation based on the very
> same /tmp
> issue problem. Too bad I couldn't remember that this week :-/
>
> | This difference is significant because on my Mac, the data file is
> saved
> | inside an R tempdir with only user read permissions:
> | drwx------ 2 a347549 pcap 40 Oct 30 14:05 Rtmp8fgNQf/
> |
> | while on Linux, the file is saved in /tmp, with whatever permissions
> | that has. So, presumably either patching the code as follows:
> | - if(as.character(Sys.info()["sysname"])=="Linux")
> | + if(as.character(Sys.info()["sysname"]) %in% c("Linux",
> "Darwin"))
>
> Agreed. Explicitly CC'ing Neil for OS X advice -- Darwin is the
> best test?
>
Dirk,
"Darwin" is correct for Mac OS X.
The test dbWriteTableTest.R works for me without this change. Is the
test not robust enough?
Neil
More information about the R-sig-DB
mailing list