Skip to content
Prev 169256 / 398506 Next

list.files changed in 2.7.0

My original message referred to the double slash and using grep. 
The particular behavior on C: wasn't the issue. For example,
[1] "C:/test1/file1" "C:/test1/file2"
[1] "C:/test1//file1" "C:/test1//file2"
[1] TRUE TRUE
[1] TRUE TRUE
[1] 2
integer(0)
In older versions of R, the last command also gave the response '2'.

While R and the OS can handle the single or double slash, grep cannot
know what I'm after.
Such unannounced changes make it harder to keep production code running
as we upgrade R versions.

It's just a fussy change, but I wondered why it was made, and whether
the behavior would change in future.

-- David


-----Original Message-----
From: henrik.bengtsson at gmail.com [mailto:henrik.bengtsson at gmail.com] On
Behalf Of Henrik Bengtsson
Sent: Tuesday, February 03, 2009 2:42 PM
To: David Reiner <davidr at rhotrading.com>
Cc: r-help at r-project.org
Subject: Re: [R] list.files changed in 2.7.0

Hi,

I've verified in "R version 2.8.1 Patched (2008-12-22 r47296)" using
both Rterm and Rgui, and

list.files(path="C:")

list the files that are in the current working directory of C: and
this *can* be changed by setwd(), that is, it does not just depend on
which directory you started R in.  The command

list.files(path="C:/")

always lists the files under the root of C:.

/Henrik
On Mon, Jan 26, 2009 at 7:48 AM, <davidr at rhotrading.com> wrote:
On
to
certain
http://www.R-project.org/posting-guide.html