2775 |
{ |
{ |
2776 |
if (errno == EXDEV) |
if (errno == EXDEV) |
2777 |
{ |
{ |
2778 |
|
struct stat data; |
2779 |
#ifdef S_IFLNK |
#ifdef S_IFLNK |
2780 |
symlink_target = Ffile_symlink_p (file); |
symlink_target = Ffile_symlink_p (file); |
2781 |
if (! NILP (symlink_target)) |
if (! NILP (symlink_target)) |
2788 |
so don't have copy-file prompt again. */ |
so don't have copy-file prompt again. */ |
2789 |
NILP (ok_if_already_exists) ? Qnil : Qt, |
NILP (ok_if_already_exists) ? Qnil : Qt, |
2790 |
Qt, Qnil); |
Qt, Qnil); |
2791 |
|
|
2792 |
|
/* Preserve owner and group, if possible (if we are root). */ |
2793 |
|
if (stat (SDATA (encoded_file), &data) >= 0) |
2794 |
|
chown (SDATA (encoded_file), data.st_uid, data.st_gid); |
2795 |
|
|
2796 |
Fdelete_file (file); |
Fdelete_file (file); |
2797 |
} |
} |
2798 |
else |
else |