[R] identicalFiles(filename1, filename2)?

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Aug 15 07:30:09 CEST 2014


On 14/08/2014 23:57, William Dunlap wrote:
> Is there a function in core R that takes 2 strings and returns TRUE if
> they refer to the same file?  (If either does not refer to a file, I
> think it would be fine if it returned FALSE.)

No, but equality for normalizePath() works well enough on most OSes 
(Unix-alikes do follow links, although if you have a file system mounted 
in multiple places I have no idea how well it copes).

>
> Compariing inode/device numbers on Unix-like systems and the output of
> normalizePath on Windows would probably do it.   Comparing files on
> non-native file systems can mess things up so perhaps we should not
> promise much.
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK



More information about the R-help mailing list