Lines Matching defs:to

6  * This code is derived from software contributed to Berkeley by
18 * may be used to endorse or promote products derived from this software
82 * assume file doesn't exist, so just try to create it, most times this
83 * works. We have to take special handling when the file does exist. To
84 * detect this, we use O_EXCL. For example when trying to create a
86 * can accidentally open the device by mistake (or block waiting to
88 * to figure out why. This strategy was found to have better average
98 * the file seems to exist. First we try to get rid of it (found to be
100 * then we go to the expense to check and create the path to the file
107 * try to open it again, if this fails, check all the nodes in
116 syswarn(1, oerrno, "Unable to create %s", arcn->name);
125 * Close file descriptor to a file just created by pax. Sets modes,
139 syswarn(0, errno, "Unable to close file descriptor on %s",
165 * Create a hard link to arcn->ln_name from arcn->name. arcn->ln_name
177 * we may be running as root, so we have to be sure that link target
181 syswarn(1,errno,"Unable to link to %s from %s", arcn->ln_name,
187 paxwarn(1, "A hard link to the directory %s is not allowed",
197 * Create a hard link to arcn->org_name from arcn->name. Only used in copy
201 * 1 if copy() should try to create this file node
202 * 0 if cross_lnk() ok, -1 for fatal flaw (like linking to self).
209 * try to make a link to original file (-l flag in copy mode). make sure
210 * we do not try to link to directories in case we are running as root
220 * In copy mode if we are not trying to make hard links between the src
221 * and destinations, make sure we are not going to overwrite ourselves by
222 * accident. This slows things down a little, but we have to protect all
247 paxwarn(1, "Unable to copy %s, file would overwrite itself",
256 * try to make a hard link between two files. if ign set, we do not
261 * 1 when ign was set to indicates we could not make the link but we
262 * should try to copy/extract the file as that might work (and is an
267 mk_link(char *to, struct stat *to_sb, char *from,
274 * if from file exists, it has to be unlinked to make the link. If the
285 paxwarn(1, "Unable to link file %s to itself", to);
290 * try to get rid of the file, based on the type
294 syswarn(1, errno, "Unable to remove %s", from);
299 syswarn(1, errno, "Unable to remove %s", from);
307 * from file is gone (or did not exist), try to make the hard link.
308 * if it fails, check the path and try it again (if chk_path() says to
312 if (link(to, from) == 0)
318 syswarn(1, oerrno, "Could not link to %s from %s", to,
350 * create node based on type, if that fails try to unlink the node and
352 * file and link creation routines, this method seems to exhibit the
400 * if we were able to create the node break out of the loop,
401 * otherwise try to unlink the node and try again. if that
408 * we failed to make the node
424 * we were able to create the node. set uid/gid, modes and times
443 * Dirs must be processed again at end of extract to set times
444 * and modes to agree with those stored in the archive. However
445 * to allow extract to continue, we may have to also set owner
447 * of this directory to be extracted without failure. Both time
458 * We have to add rights to the dir, so we make
459 * sure to restore the mode. The mode must be
470 * we have to force the mode to what was set here,
486 * of the node that is going to replace it. When we try to create a
487 * directory and find that it already exists, we allow processing to
490 * 0 is ok to proceed, no file with the specified name exists
491 * -1 we were unable to remove the node, or we should not remove it (-k)
492 * 1 we found a directory and we were going to create a directory.
510 * try to remove a directory, if it fails and we were going to
516 syswarn(1,errno,"Unable to remove directory %s", name);
523 * try to get rid of all non-directory type nodes
534 * We were trying to create some kind of node in the file system and it
535 * failed. chk_path() makes sure the path up to the node exists and is
536 * writeable. When we have to create a directory that is missing along the
537 * path somewhere, the directory we create will be set to the same
540 * last resort when trying to create entries in the file system.
542 * -1 when it could find nothing it is allowed to fix.
570 * the spec (at least it seems to read that way) to alter the
573 * and figure out how to get rid of it (probably like some
593 * we were able to create the directory. We will tell the
594 * caller that we found something to fix, and it is ok to try
603 * causes this newly created directory to be unusable. We fix
604 * the modes and restore them back to the creation default at
621 * non-zero we force these times to be set even if the user did not
623 * used by -t to reset access times).
649 syswarn(0,errno,"Unable to obtain file stats %s", fnm);
678 syswarn(1, errno, "Unable to set file uid/gid of %s",
702 * how to copy files with lseek holes in it. (Which are read as file
708 * way (there is no way to determine if the file block is really a hole,
710 * At this writing, no major archive format knows how to archive files
711 * with holes. However, on extraction (or during copy, -rw) we have to
713 * consume a lot of file space if just written to disk. This replacement
719 * input. once we have written a file block, we continue to write it to
723 * that are NOT very sparse. This overhead (when compared to a write) is
733 * FILE, make sure to call file_flush() when the last write finishes with
735 * the end. In this case we drop a single 0 at the end to force the
739 * isempt: have we written to the file block yet (is it empty)
742 * str: buffer to write
757 * while we have data to process
771 * only examine up to the end of the current file block or
772 * remaining characters to write, whatever is smaller
779 * have not written to this block yet, so we keep
810 * have non-zero data in this file system block, have to write
813 syswarn(1, errno, "Failed write to file %s", name);
849 syswarn(1, errno, "Failed write to file %s", fname);
855 * close a file we have beed reading (to copy or archive). If we have to
882 * read a file to calculate its crc. This is a real drag. Archive formats
883 * that have this, end up reading the file twice (we have to write the
886 * 0 if was able to calculate the crc, -1 otherwise
913 * is trying to archive an active file, forget this file.
924 * safety check. we want to avoid archiving files that are active as