Skip to content

Trailing "/" makes file.exists() return FALSE (PR#1098)

1 message · Brian Ripley

#
On Mon, 24 Sep 2001, Henrik Bengtsson wrote:

            
But the underlying OSes are not consistent, and the nature of your `bug'
report is that R is being truthful on each.  Which is the sort of
consistency we want.
That's not correct, and not in the current R sources.  It is a
documentation bug that has already been fixed: search the bug report
database for system.file (it's not talking to me right now).
In which case think what happens when file.exists() incorrectly reports a
file as existing when it does not, and the user then tries to make use of
the file?  Let me stress (since you do seem to have missed the point) that
"foo/" is not a file on Windows, nor a directory on Windows. It does not
exist.  Whatever would be the point of a test that lied to you?