On 25/03/2009, at 6:29 AM, Gregoire Pau wrote:

Hello,

How can I test in R whether a file is a symbolic link or not ? I haven't
found anything relevant in R-help but I may be wrong.
Thanks !

Since symbolic links are a Unix thing, I assume you are working on a system
that is sufficiently Unix-like for the following roll-your-own to work:

cfsl <- function(file) {
# cfsl <--> "check for symbolic link"
xxx <- system(paste("ls -l",file),intern=TRUE)
if(substr(xxx,1,1)=="l") TRUE else FALSE
}

HTH

        cheers,

                Rolf Turner


######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
R-help@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.

Reply via email to