[Rd] Possible bug: file.exists() always returns TRUE for prn.us.txt

Joris Meys jorismeys at gmail.com
Sat Mar 24 11:16:51 CET 2018

Dear all,

while preparing some exercises I came across some highly surprising
behaviour of file.exists(). The specific value "prn.us.txt" always returns
TRUE, even though that file is nowhere to be found on my system.

In a fresh R session 3.4.4 installed on Windows 10:

> grep("prn.us.txt", dir(recursive = TRUE))
> file.exists("prn.us.txt")
[1] TRUE
> file.exists("pnr.us.txt")
> file.exists("prn\\.us\\.txt")

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)

Matrix products: default

[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.4.4

This also happens in 3.4.3, 3.4.2 and 3.4.1 . It is confirmed by Roman
Lustrik on his system as well :

I suspect this is a bug, or I must be missing something completely.


Joris Meys
Statistical consultant

Department of Data Analysis and Mathematical Modelling
Ghent University
Coupure Links 653, B-9000 Gent (Belgium)

Biowiskundedagen 2017-2018

Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

	[[alternative HTML version deleted]]

More information about the R-devel mailing list