This is more efficient than Ffile_directory_p and avoids a minor race.
+2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
+ This is more efficient than Ffile_directory_p and avoids a minor race.
+
2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
* buffer.c (Foverlay_put): Say what the return value is
regardless of what access permissions it has. */
if (lstat (SSDATA (encoded_filename), &statbuf) >= 0)
{
- if (Ffile_directory_p (absname))
+ if (S_ISDIR (statbuf.st_mode))
xsignal2 (Qfile_error,
build_string ("File is a directory"), absname);