Lines Matching refs:to

28  * Copies "from" to "to".
31 copy_file (from, to)
33 const char *to;
41 CLIENT_SERVER_STR, from, to);
45 /* If the file to be copied is a link or a device, then just create
50 symlink (source, to);
60 mknod (to, sb.st_mode, sb.st_rdev);
72 if ((fdout = creat (to, (int) sb.st_mode & 07777)) < 0)
73 error (1, errno, "cannot create %s for copying", to);
94 error (1, errno, "cannot write file %s for copying", to);
100 error (1, errno, "cannot fsync file %s after copying", to);
107 error (1, errno, "cannot close %s", to);
114 (void) utime (to, &t);
122 * link which points to a directory.
207 * Returns non-zero if the argument file is accessable according to
298 * Make a path to the argument directory, printing a message if something
314 error (0, errno, "cannot make path to %s", name);
348 * Don't do anything if PreservePermissions is set to `yes'. This may
397 rename_file (from, to)
399 const char *to;
403 CLIENT_SERVER_STR, from, to);
407 if (rename (from, to) < 0)
408 error (1, errno, "cannot rename file %s to %s", from, to);
439 it is not OK to send output (e.g. after we sent "ok" to the
447 /* For at least some unices, if root tries to unlink() a directory,
450 So we first call stat() to see if it is OK to call unlink(). This
452 call to stat() and the call to unlink(), we'll still corrupt
485 (it defines ENOTEMPTY and EEXIST to 17 but actually
490 /* If unable to open the directory return
546 /* Was able to remove the directory return 0 */
586 * Compare "file1" to "file2". Return non-zero if they don't compare exactly.
609 /* If FILE1 and FILE2 are symlinks, they are equal if they point to
645 to see if the two files being compared are actually the same file.
688 /* Generate a unique temporary filename. Returns a pointer to a newly
695 * they should be converted too but I don't have time to look into it right
706 error (1, errno, "Failed to create temporary file %s",
709 error (0, errno, "Failed to close temporary file %s", fn);
714 * to the truncated file by that name
717 * filename where to place the pointer to the newly allocated file
721 * filename dereferenced, will point to the newly allocated file
726 * An open file pointer to a read/write mode empty temporary file with the
730 * on error, errno will be set to some value either by CVS_FOPEN or
731 * whatever system function is called to generate the temporary file name
736 * mkstemp, tempnam, and mktemp both allow to specify the directory in which
739 * And the _correct_ way to use the deprecated functions probably involves
741 * NFS locking thing, but until I hear of more problems, I'm not going to
751 /* FIXME - I'd like to be returning NULL here in noexec mode, but I think
773 /* Attempt to close and unlink the file since mkstemp returned
778 error (0, errno, "Failed to close temporary file %s", fn);
780 error (0, errno, "Failed to unlink temporary file %s", fn);
789 /* mkstemp is defined to open mode 0600 using glibc 2.0.7+ */
791 * linking to and not chmod for 2.0.7+
799 /* tempnam has been deprecated due to under-specification */
810 /* tempnam returns a pointer to a newly malloc'd string, so there's
816 /* mktemp has been deprecated due to the BSD 4.3 specification specifying
881 * This function exits with a fatal error if it fails to read the link for
893 /* Get the name of the file to which `from' is linked. */
943 * This function exits with a fatal error if it fails to read the link for
961 error ( 1, errno, "cannot chdir to %s", path );
965 error ( 1, errno, "cannot chdir to %s", owd );
986 /* Return the home directory. Returns a pointer to storage
997 (which is bad, when various parts of CVS try to read there). One
998 fix would be to make the value returned by get_homedir only good
1000 would be to just always malloc our answer, and let the caller free
1001 it (that is best, because some day we may need to be reentrant).
1003 The workaround is to put -f in inetd.conf which means that
1030 /* Compose a path to a file in the home directory. This is necessary because
1034 * "join a directory to a filename" kind of thing which was not specific to
1037 * interesting to see how much of the code was written in C since Perl is under
1038 * the GPL and the Artistic license - we might be able to use it.