[R] setwd() command on windows vs. linux/unix

John McKown john.archie.mckown at gmail.com
Mon Jul 27 22:02:30 CEST 2015


On Mon, Jul 27, 2015 at 2:38 PM, Chris <chris.barker at barkerstats.com> wrote:

>
> I have a script that runs correctly (no errors) on Windows, the first
> command is a "setwd(.....windows directory)"I installed the script on a
> Linux machine and changed the windows directory reference to the correct
> directory on the linux machine.when I ran the script I got a message that
> "cannot change working directory". I confirmed I have read and write access
> to the directory.I mainly run R on windows infrequently use linux/unix and
> would appreciate suggestions.thanks in advance Chris Barker, Ph.D.
> Adjunct Associate Professor of Biostatistics - UIC-SPH
>
>
​I took a quick look at the source where I _think_ the message is coming
from: src/main/util.c . That message comes out when the chdir() function (C
library routine) returns any kind of error.​ Because you said that have
read & write access (you should also have execute in most cases), then the
only return which makes sense is ENAMETOOLONG (although it could also be
ENOMEM). How long is the path name? The usual limit is 255 bytes.



-- 

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

	[[alternative HTML version deleted]]



More information about the R-help mailing list