Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

hadley wickham
I've run into a problem with dir.create on R2.2.0 Windows XP 2002 SP 2.

setwd("d:/")
print(dir.create("d:\\otis-sim\\rdata", recursive=T))
print(dir.create("d:\\otis-sim\\", recursive=T))

Both return false and fail to create the directories.

setwd("c:/")
print(dir.create("d:\\otis-sim\\rdata", recursive=T))

Returns true and succesfully creates the directories.

Why does this occur?

Hadley

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

Liaw, Andy
No problem for me (Version 2.2.0  (2005-10-06 r35749), WinXPPro SP2):

> setwd("q:/")
> print(dir.create("q:/Andy/what/is/this", recursive=TRUE))
[1] TRUE
> setwd("c:/")
> print(dir.create("q:/Andy/what/is/that/thing", recursive=TRUE))
[1] TRUE

Andy

From: hadley wickham

>
> I've run into a problem with dir.create on R2.2.0 Windows XP
> 2002 SP 2.
>
> setwd("d:/")
> print(dir.create("d:\\otis-sim\\rdata", recursive=T))
> print(dir.create("d:\\otis-sim\\", recursive=T))
>
> Both return false and fail to create the directories.
>
> setwd("c:/")
> print(dir.create("d:\\otis-sim\\rdata", recursive=T))
>
> Returns true and succesfully creates the directories.
>
> Why does this occur?
>
> Hadley
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

Mike Prager
In reply to this post by hadley wickham
I hope this isn't an insulting question, but does drive D: exist on that
machine?

Mike

on 12/14/2005 11:09 AM hadley wickham said the following:

>I've run into a problem with dir.create on R2.2.0 Windows XP 2002 SP 2.
>
>setwd("d:/")
>print(dir.create("d:\\otis-sim\\rdata", recursive=T))
>print(dir.create("d:\\otis-sim\\", recursive=T))
>
>Both return false and fail to create the directories.
>
>setwd("c:/")
>print(dir.create("d:\\otis-sim\\rdata", recursive=T))
>
>Returns true and succesfully creates the directories.
>
>Why does this occur?
>
>Hadley
>
>  
>

--

Michael Prager, Ph.D.
Population Dynamics Team, NMFS SE Fisheries Science Center
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516
http://shrimp.ccfhrb.noaa.gov/~mprager/
Opinions expressed are personal, not official.  No
government endorsement of any product is made or implied.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

hadley wickham
> I hope this isn't an insulting question, but does drive D: exist on that
> machine?

Yes, it definitely does!  I'd expect setwd("d:/") to give an error if it didn't

Hadley

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

Mike Prager
on 12/14/2005 4:43 PM hadley wickham said the following:

>>I hope this isn't an insulting question, but does drive D: exist on that
>>machine?
>>    
>>
>
>Yes, it definitely does!  I'd expect setwd("d:/") to give an error if it didn't
>
>Hadley
>  
>
H

Oops.  You are right, of course.

I checked that on nonexistent drive "Q:" here.  However, it turns out
that our system administrators have installed a network drive mapped to
Q:, so it really does exist.

M

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

Prof Brian Ripley
In reply to this post by Liaw, Andy
One comment is that Windows does not like trailing directory separators as
in

print(dir.create("d:\\otis-sim\\", recursive=T))

and so this will give a warning as in

> print(dir.create("d:\\otis-sim\\", recursive=T))
[1] FALSE
Warning message:
'd:\otis-sim\' already exists

Beyond that, the code is designed for Unix-like file systems and does not
expect drives.

setwd("d:/")
print(dir.create("\\otis-sim\\foo", recursive=T))

seems to work reliably.  The issue seems to depend on what the current
directory on the drive is (if a drive is specified), and I've made an
adjustment for 2.2.1 to workaround that.


On Wed, 14 Dec 2005, Liaw, Andy wrote:

> No problem for me (Version 2.2.0  (2005-10-06 r35749), WinXPPro SP2):
>
>> setwd("q:/")
>> print(dir.create("q:/Andy/what/is/this", recursive=TRUE))
> [1] TRUE
>> setwd("c:/")
>> print(dir.create("q:/Andy/what/is/that/thing", recursive=TRUE))
> [1] TRUE
>
> Andy
>
> From: hadley wickham
>>
>> I've run into a problem with dir.create on R2.2.0 Windows XP
>> 2002 SP 2.
>>
>> setwd("d:/")
>> print(dir.create("d:\\otis-sim\\rdata", recursive=T))
>> print(dir.create("d:\\otis-sim\\", recursive=T))
>>
>> Both return false and fail to create the directories.
>>
>> setwd("c:/")
>> print(dir.create("d:\\otis-sim\\rdata", recursive=T))
>>
>> Returns true and succesfully creates the directories.
>>
>> Why does this occur?
>>
>> Hadley
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>>
>>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

Peter Dalgaard
In reply to this post by hadley wickham
hadley wickham <[hidden email]> writes:

> > I hope this isn't an insulting question, but does drive D: exist on that
> > machine?
>
> Yes, it definitely does!  I'd expect setwd("d:/") to give an error if it didn't

What is the file system? I seem to recall that the top directory of a
(V)FAT drive is somehow special, so setwd'ing to it might put a lock
on it. Not that I know what I'm talking about, but Windows is
notorious for that sort of thing.

--
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])                  FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)

Prof Brian Ripley
On Wed, 14 Dec 2005, Peter Dalgaard wrote:

> hadley wickham <[hidden email]> writes:
>
>>> I hope this isn't an insulting question, but does drive D: exist on that
>>> machine?
>>
>> Yes, it definitely does!  I'd expect setwd("d:/") to give an error if it didn't
>
> What is the file system? I seem to recall that the top directory of a
> (V)FAT drive is somehow special, so setwd'ing to it might put a lock
> on it. Not that I know what I'm talking about, but Windows is
> notorious for that sort of thing.

Indeed, but only in so far that the directory is non-extensible (e.g.
limited to 112 files).  I thought it might be that a lock, but it is a
simple question of sometimes mis-parsing paths with drives in them.

--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Loading...