From kirill.mueller at ivt.baug.ethz.ch  Fri Jan 17 18:25:41 2014
From: kirill.mueller at ivt.baug.ethz.ch (=?ISO-8859-1?Q?Kirill_M=FCller?=)
Date: Fri, 17 Jan 2014 18:25:41 +0100
Subject: [Rd] file.exists does not like path names ending in /
In-Reply-To: <CAP01uRmv3VmecKQMtyoAQM_yifKXcKtw1D66djbJ459fxtQRGw@mail.gmail.com>
References: <CAP01uRmStfL2Kd0AK0KGGkdeUY_Qbde885AfSDy8VNDHbras7g@mail.gmail.com>	<21209.4385.976759.215210@stat.math.ethz.ch>
	<CAP01uRmv3VmecKQMtyoAQM_yifKXcKtw1D66djbJ459fxtQRGw@mail.gmail.com>
Message-ID: <52D96795.8040604@ivt.baug.ethz.ch>

On 01/17/2014 02:56 PM, Gabor Grothendieck wrote:
> At the moment I am using this to avoid the
> problem:
>
> File.exists <- function(x) {
>     if (.Platform$OS == "windows" && grepl("[/\\]$", x)) {
>         file.exists(dirname(x))
>     } else file.exists(x)
> }
>
> but it would be nice if that could be done by file.exists itself.
I think that ignoring a terminal slash/backslash on Windows would do no 
harm: It would improve consistency between platforms, and perhaps nobody 
really relies on the current behavior. Would shorten the documentation, too.


-Kirill



[Rd] file.exists does not like path names ending in /
=?ISO-8859-1?Q?Kirill_M=FCller?=