return call2 (handler, Qfile_name_as_directory, file);
buf = (char *) alloca (SBYTES (file) + 10);
- file_name_as_directory (buf, SDATA (file));
+ file_name_as_directory (buf, SSDATA (file));
return make_specified_string (buf, -1, strlen (buf),
STRING_MULTIBYTE (file));
}
return call2 (handler, Qdirectory_file_name, directory);
buf = (char *) alloca (SBYTES (directory) + 20);
- directory_file_name (SDATA (directory), buf);
+ directory_file_name (SSDATA (directory), buf);
return make_specified_string (buf, -1, strlen (buf),
STRING_MULTIBYTE (directory));
}
#ifdef WINDOWSNT
if (IS_DIRECTORY_SEP (nm[1]))
{
- if (strcmp (nm, SDATA (name)) != 0)
+ if (strcmp (nm, SSDATA (name)) != 0)
name = make_specified_string (nm, -1, strlen (nm), multibyte);
}
else
}
return name;
#else /* not DOS_NT */
- if (strcmp (nm, SDATA (name)) == 0)
+ if (strcmp (nm, SSDATA (name)) == 0)
return name;
return make_specified_string (nm, -1, strlen (nm), multibyte);
#endif /* not DOS_NT */
orig = make_unibyte_string (o, orig_length);
decoded = DECODE_FILE (orig);
decoded_length = SBYTES (decoded);
- strncpy (x, SDATA (decoded), decoded_length);
+ strncpy (x, SSDATA (decoded), decoded_length);
x += decoded_length;
/* If environment variable needed decoding, return value
needs to be multibyte. */
if (decoded_length != orig_length
- || strncmp (SDATA (decoded), o, orig_length))
+ || strncmp (SSDATA (decoded), o, orig_length))
multibyte = 1;
}
}
/* stat is a good way to tell whether the file exists,
regardless of what access permissions it has. */
- if (lstat (SDATA (encoded_filename), &statbuf) >= 0)
+ if (lstat (SSDATA (encoded_filename), &statbuf) >= 0)
{
if (! interactive)
xsignal2 (Qfile_already_exists,
|| INTEGERP (ok_if_already_exists))
barf_or_query_if_file_exists (newname, "copy to it",
INTEGERP (ok_if_already_exists), &out_st, 0);
- else if (stat (SDATA (encoded_newname), &out_st) < 0)
+ else if (stat (SSDATA (encoded_newname), &out_st) < 0)
out_st.st_mode = 0;
#ifdef WINDOWSNT
}
#else /* not WINDOWSNT */
immediate_quit = 1;
- ifd = emacs_open (SDATA (encoded_file), O_RDONLY, 0);
+ ifd = emacs_open (SSDATA (encoded_file), O_RDONLY, 0);
immediate_quit = 0;
if (ifd < 0)
| (NILP (ok_if_already_exists) ? O_EXCL : 0),
S_IREAD | S_IWRITE);
#else /* not MSDOS */
- ofd = emacs_open (SDATA (encoded_newname),
+ ofd = emacs_open (SSDATA (encoded_newname),
O_WRONLY | O_TRUNC | O_CREAT
| (NILP (ok_if_already_exists) ? O_EXCL : 0),
0666);
EMACS_TIME atime, mtime;
EMACS_SET_SECS_USECS (atime, st.st_atime, 0);
EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0);
- if (set_file_times (SDATA (encoded_newname),
+ if (set_file_times (SSDATA (encoded_newname),
atime, mtime))
xsignal2 (Qfile_date_error,
build_string ("Cannot set file date"), newname);
encoded_file = ENCODE_FILE (filename);
- if (0 > unlink (SDATA (encoded_file)))
+ if (0 > unlink (SSDATA (encoded_file)))
report_file_error ("Removing old name", list1 (filename));
return Qnil;
}
|| INTEGERP (ok_if_already_exists))
barf_or_query_if_file_exists (newname, "rename to it",
INTEGERP (ok_if_already_exists), 0, 0);
- if (0 > rename (SDATA (encoded_file), SDATA (encoded_newname)))
+ if (0 > rename (SSDATA (encoded_file), SSDATA (encoded_newname)))
{
if (errno == EXDEV)
{
barf_or_query_if_file_exists (newname, "make it a new name",
INTEGERP (ok_if_already_exists), 0, 0);
- unlink (SDATA (newname));
- if (0 > link (SDATA (encoded_file), SDATA (encoded_newname)))
+ unlink (SSDATA (newname));
+ if (0 > link (SSDATA (encoded_file), SSDATA (encoded_newname)))
report_file_error ("Adding new name", list2 (file, newname));
UNGCPRO;
|| INTEGERP (ok_if_already_exists))
barf_or_query_if_file_exists (linkname, "make it a link",
INTEGERP (ok_if_already_exists), 0, 0);
- if (0 > symlink (SDATA (encoded_filename),
- SDATA (encoded_linkname)))
+ if (0 > symlink (SSDATA (encoded_filename),
+ SSDATA (encoded_linkname)))
{
/* If we didn't complain already, silently delete existing file. */
if (errno == EEXIST)
{
- unlink (SDATA (encoded_linkname));
- if (0 <= symlink (SDATA (encoded_filename),
- SDATA (encoded_linkname)))
+ unlink (SSDATA (encoded_linkname));
+ if (0 <= symlink (SSDATA (encoded_filename),
+ SSDATA (encoded_linkname)))
{
UNGCPRO;
return Qnil;
absname = ENCODE_FILE (absname);
- return (stat (SDATA (absname), &statbuf) >= 0) ? Qt : Qnil;
+ return (stat (SSDATA (absname), &statbuf) >= 0) ? Qt : Qnil;
}
DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0,
absname = ENCODE_FILE (absname);
- return (check_executable (SDATA (absname)) ? Qt : Qnil);
+ return (check_executable (SSDATA (absname)) ? Qt : Qnil);
}
DEFUN ("file-readable-p", Ffile_readable_p, Sfile_readable_p, 1, 1, 0,
/* 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. */
- desc = stat (SDATA (absname), &statbuf);
+ desc = stat (SSDATA (absname), &statbuf);
if (desc < 0)
return Qnil;
if (S_ISFIFO (statbuf.st_mode))
flags |= O_NONBLOCK;
#endif
- desc = emacs_open (SDATA (absname), flags, 0);
+ desc = emacs_open (SSDATA (absname), flags, 0);
if (desc < 0)
return Qnil;
emacs_close (desc);
return call2 (handler, Qfile_writable_p, absname);
encoded = ENCODE_FILE (absname);
- if (stat (SDATA (encoded), &statbuf) >= 0)
- return (check_writable (SDATA (encoded))
+ if (stat (SSDATA (encoded), &statbuf) >= 0)
+ return (check_writable (SSDATA (encoded))
? Qt : Qnil);
dir = Ffile_name_directory (absname);
encoded_filename = ENCODE_FILE (absname);
- fd = emacs_open (SDATA (encoded_filename), O_RDONLY, 0);
+ fd = emacs_open (SSDATA (encoded_filename), O_RDONLY, 0);
if (fd < 0)
- report_file_error (SDATA (string), Fcons (filename, Qnil));
+ report_file_error (SSDATA (string), Fcons (filename, Qnil));
emacs_close (fd);
return Qnil;
memset (buf, 0, bufsize);
errno = 0;
- valsize = readlink (SDATA (filename), buf, bufsize);
+ valsize = readlink (SSDATA (filename), buf, bufsize);
if (valsize == -1)
{
#ifdef ERANGE
absname = ENCODE_FILE (absname);
- if (stat (SDATA (absname), &st) < 0)
+ if (stat (SSDATA (absname), &st) < 0)
return Qnil;
return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil;
}
return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil;
}
#else
- if (stat (SDATA (absname), &st) < 0)
+ if (stat (SSDATA (absname), &st) < 0)
return Qnil;
return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil;
#endif
absname = ENCODE_FILE (absname);
- if (stat (SDATA (absname), &st) < 0)
+ if (stat (SSDATA (absname), &st) < 0)
return Qnil;
return make_number (st.st_mode & 07777);
encoded_absname = ENCODE_FILE (absname);
- if (chmod (SDATA (encoded_absname), XINT (mode)) < 0)
+ if (chmod (SSDATA (encoded_absname), XINT (mode)) < 0)
report_file_error ("Doing chmod", Fcons (absname, Qnil));
return Qnil;
EMACS_SET_SECS (t, sec);
EMACS_SET_USECS (t, usec);
- if (set_file_times (SDATA (encoded_absname), t, t))
+ if (set_file_times (SSDATA (encoded_absname), t, t))
{
#ifdef DOS_NT
struct stat st;
absname2 = ENCODE_FILE (absname2);
UNGCPRO;
- if (stat (SDATA (absname1), &st) < 0)
+ if (stat (SSDATA (absname1), &st) < 0)
return Qnil;
mtime1 = st.st_mtime;
- if (stat (SDATA (absname2), &st) < 0)
+ if (stat (SSDATA (absname2), &st) < 0)
return Qt;
return (mtime1 > st.st_mtime) ? Qt : Qnil;
/* Tell stat to use expensive method to get accurate info. */
Vw32_get_true_file_attributes = Qt;
- total = stat (SDATA (filename), &st);
+ total = stat (SSDATA (filename), &st);
Vw32_get_true_file_attributes = tem;
}
if (total < 0)
#else
- if (stat (SDATA (filename), &st) < 0)
+ if (stat (SSDATA (filename), &st) < 0)
#endif /* WINDOWSNT */
{
if (fd >= 0) emacs_close (fd);
#endif
if (fd < 0)
- if ((fd = emacs_open (SDATA (filename), O_RDONLY, 0)) < 0)
+ if ((fd = emacs_open (SSDATA (filename), O_RDONLY, 0)) < 0)
goto badopen;
/* Replacement should preserve point as it preserves markers. */
coding->produced -=
emacs_write (desc,
STRINGP (coding->dst_object)
- ? SDATA (coding->dst_object)
- : BYTE_POS_ADDR (coding->dst_pos_byte),
+ ? SSDATA (coding->dst_object)
+ : (char *) BYTE_POS_ADDR (coding->dst_pos_byte),
coding->produced);
if (coding->produced)
filename = ENCODE_FILE (b->filename);
- if (stat (SDATA (filename), &st) < 0)
+ if (stat (SSDATA (filename), &st) < 0)
{
/* If the file doesn't exist now and didn't exist before,
we say that it isn't modified, provided the error is a tame one. */
filename = ENCODE_FILE (filename);
- if (stat (SDATA (filename), &st) >= 0)
+ if (stat (SSDATA (filename), &st) >= 0)
{
current_buffer->modtime = st.st_mtime;
current_buffer->modtime_size = st.st_size;
/* Get visited file's mode to become the auto save file's mode. */
if (! NILP (current_buffer->filename))
{
- if (stat (SDATA (current_buffer->filename), &st) >= 0)
+ if (stat (SSDATA (current_buffer->filename), &st) >= 0)
/* But make sure we can overwrite it later! */
auto_save_mode_bits = st.st_mode | 0600;
else if ((modes = Ffile_modes (current_buffer->filename),
UNGCPRO;
}
- stream = fopen (SDATA (listfile), "w");
+ stream = fopen (SSDATA (listfile), "w");
}
record_unwind_protect (do_auto_save_unwind,