symlink?(p1)
public
Returns true if the named file is a symbolic link.
Show source
static VALUE
rb_file_symlink_p(VALUE obj, VALUE fname)
{
struct stat st;
FilePathValue(fname);
fname = rb_str_encode_ospath(fname);
if (lstat(StringValueCStr(fname), &st) < 0) return Qfalse;
if (S_ISLNK(st.st_mode)) return Qtrue;
return Qfalse;
}