Lines Matching defs:to
17 along with this program; if not, write to the Free Software
36 /* The number of bytes to copy at once. */
39 /* Copy file FROM to file TO, performing no translations.
43 simple_copy (const char *from, const char *to)
53 tofd = open (to, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0777);
55 tofd = creat (to, 0777);
87 /* Set the times of the file DESTINATION to be the same as those in
134 /* Rename FROM to TO, copying if TO is a link.
138 smart_rename (const char *from, const char *to, int preserve_dates ATTRIBUTE_UNUSED)
144 exists = lstat (to, &s) == 0;
147 /* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
151 remove (to);
153 ret = rename (from, to);
156 /* We have to clean up here. */
157 non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno));
162 only one hard link, and we have permission to write to it. */
170 ret = rename (from, to);
175 /* Try to preserve the permission bits and ownership of
180 able to do the chmod afterward. We don't bother to
185 want to introduce an unexpected setuid file owned by
187 chmod (to, s.st_mode & 0777);
188 if (chown (to, s.st_uid, s.st_gid) >= 0)
189 chmod (to, s.st_mode & 07777);
194 /* We have to clean up here. */
195 non_fatal (_("unable to rename '%s'; reason: %s"), to, strerror (errno));
201 ret = simple_copy (from, to);
203 non_fatal (_("unable to copy file '%s'; reason: %s"), to, strerror (errno));
206 set_times (to, &s);