Lines Matching refs:src
51 static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, unsigned int options…
99 static void printCopyMsg(const char* src, const char* dst, unsigned int options) in printCopyMsg() argument
102 printf(" '%s' --> '%s'\n", src, dst); in printCopyMsg()
105 static void printNotNewerMsg(const char* src, const char* dst, unsigned int options) in printNotNewerMsg() argument
116 static int copyFileContents(const char* dst, int dstFd, const char* src, int srcFd) in copyFileContents() argument
128 "acp: failed reading '%s': %s\n", src, strerror(errno)); in copyFileContents()
209 static int copyRegular(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int … in copyRegular() argument
214 DBUG(("--- copying regular '%s' to '%s'\n", src, dst)); in copyRegular()
230 src, dst); in copyRegular()
235 DBUG(("--- source is not newer: '%s'\n", src)); in copyRegular()
236 printNotNewerMsg(src, dst, options); in copyRegular()
243 srcFd = open(src, O_RDONLY | O_BINARY, 0); in copyRegular()
245 fprintf(stderr, "acp: unable to open '%s': %s\n", src, strerror(errno)); in copyRegular()
291 copyResult = copyFileContents(dst, dstFd, src, srcFd); in copyRegular()
304 srcRsrcName = malloc(strlen(src) + 5 + 1); in copyRegular()
305 strcpy(srcRsrcName, src); in copyRegular()
336 printCopyMsg(src, dst, options); in copyRegular()
351 static int copySymlink(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int … in copySymlink() argument
358 DBUG(("--- copying symlink '%s' to '%s'\n", src, dst)); in copySymlink()
375 src, dst); in copySymlink()
380 DBUG(("--- source is not newer: '%s'\n", src)); in copySymlink()
381 printNotNewerMsg(src, dst, options); in copySymlink()
388 nameLen = readlink(src, linkBuf, sizeof(linkBuf)-1); in copySymlink()
391 src, strerror(errno)); in copySymlink()
421 printCopyMsg(src, dst, options); in copySymlink()
431 int copyDirectory(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int optio… in copyDirectory() argument
438 DBUG(("--- copy dir '%s' to '%s'\n", src, dst)); in copyDirectory()
454 src, dst); in copyDirectory()
467 printCopyMsg(src, dst, options); in copyDirectory()
473 dir = opendir(src); in copyDirectory()
476 src, strerror(errno)); in copyDirectory()
497 srcLen = strlen(src); in copyDirectory()
501 memcpy(srcFile, src, srcLen); in copyDirectory()
530 static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, unsigned int options) in copyFileRecursive() argument
543 statResult = lstat(src, &srcStat); in copyFileRecursive()
545 statResult = stat(src, &srcStat); in copyFileRecursive()
561 tmpFd = open(src, O_RDONLY | O_BINARY, 0); in copyFileRecursive()
574 srcExe = malloc(strlen(src) + 4 +1); in copyFileRecursive()
575 strcpy(srcExe, src); in copyFileRecursive()
592 src = srcExe; in copyFileRecursive()
601 fprintf(stderr, "acp: file '%s' does not exist\n", src); in copyFileRecursive()
604 src, strerror(statErrno)); in copyFileRecursive()
617 fprintf(stderr, "acp: omitting directory '%s'\n", src); in copyFileRecursive()
619 retVal = copyDirectory(src, dst, &srcStat, options); in copyFileRecursive()
623 retVal = copySymlink(src, dst, &srcStat, options); in copyFileRecursive()
626 retVal = copyRegular(src, dst, &srcStat, options); in copyFileRecursive()
629 src, srcStat.st_mode); in copyFileRecursive()
640 int copyFile(const char* src, const char* dst, unsigned int options) in copyFile() argument
642 return copyFileRecursive(src, dst, true, options); in copyFile()