if (errno == EXDEV)
{
int count;
-#ifdef S_IFLNK
symlink_target = Ffile_symlink_p (file);
if (! NILP (symlink_target))
Fmake_symbolic_link (symlink_target, newname,
NILP (ok_if_already_exists) ? Qnil : Qt);
- else
-#endif
- if (!NILP (Ffile_directory_p (file)))
+ else if (!NILP (Ffile_directory_p (file)))
call4 (Qcopy_directory, file, newname, Qt, Qnil);
else
/* We have already prompted if it was an integer, so don't
count = SPECPDL_INDEX ();
specbind (Qdelete_by_moving_to_trash, Qnil);
- if (!NILP (Ffile_directory_p (file))
-#ifdef S_IFLNK
- && NILP (symlink_target)
-#endif
- )
+ if (!NILP (Ffile_directory_p (file)) && NILP (symlink_target))
call2 (Qdelete_directory, file, Qt);
else
Fdelete_file (file, Qnil);
RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename,
linkname, ok_if_already_exists));
-#ifdef S_IFLNK
encoded_filename = ENCODE_FILE (filename);
encoded_linkname = ENCODE_FILE (linkname);
return Qnil;
}
}
+ if (errno == ENOSYS)
+ {
+ UNGCPRO;
+ xsignal1 (Qfile_error,
+ build_string ("Symbolic links are not supported"));
+ }
report_file_error ("Making symbolic link", list2 (filename, linkname));
}
UNGCPRO;
return Qnil;
-
-#else
- UNGCPRO;
- xsignal1 (Qfile_error, build_string ("Symbolic links are not supported"));
-
-#endif /* S_IFLNK */
}
\f
return Qnil;
#else /* not DOS_NT and not macintosh */
flags = O_RDONLY;
-#if defined (S_IFIFO) && defined (O_NONBLOCK)
+#ifdef O_NONBLOCK
/* Opening a fifo without O_NONBLOCK can wait.
We don't want to wait. But we don't want to mess wth O_NONBLOCK
except in the case of a fifo, on a system which handles it. */
(Lisp_Object filename)
{
Lisp_Object handler;
+ char *buf;
+ int bufsize;
+ int valsize;
+ Lisp_Object val;
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
if (!NILP (handler))
return call2 (handler, Qfile_symlink_p, filename);
-#ifdef S_IFLNK
- {
- char *buf;
- int bufsize;
- int valsize;
- Lisp_Object val;
-
filename = ENCODE_FILE (filename);
bufsize = 50;
xfree (buf);
val = DECODE_FILE (val);
return val;
- }
-#else /* not S_IFLNK */
- return Qnil;
-#endif /* not S_IFLNK */
}
DEFUN ("file-directory-p", Ffile_directory_p, Sfile_directory_p, 1, 1, 0,