• Home
  • Raw
  • Download

Lines Matching refs:dst

51 static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, unsigned int options…
82 static void printCopyMsg(const char* src, const char* dst, unsigned int options) in printCopyMsg() argument
85 printf(" '%s' --> '%s'\n", src, dst); in printCopyMsg()
88 static void printNotNewerMsg(const char* src, const char* dst, unsigned int options) in printNotNewerMsg() argument
91 printf(" '%s' is up-to-date\n", dst); in printNotNewerMsg()
99 static int copyFileContents(const char* dst, int dstFd, const char* src, int srcFd) in copyFileContents() argument
119 "acp: failed writing '%s': %s\n", dst, strerror(errno)); in copyFileContents()
124 dst, writeCount, readCount); in copyFileContents()
143 static int setPermissions(const char* dst, const struct stat* pSrcStat, unsigned int options) in setPermissions() argument
154 if (utime(dst, &ut) != 0) { in setPermissions()
156 dst, strerror(errno))); in setPermissions()
164 if (chmod(dst, pSrcStat->st_mode & ~(S_IFMT)) != 0) { in setPermissions()
166 dst, pSrcStat->st_mode & ~(S_IFMT), strerror(errno))); in setPermissions()
172 if (chown(dst, pSrcStat->st_uid, pSrcStat->st_gid) != 0) { in setPermissions()
174 dst, pSrcStat->st_uid, pSrcStat->st_gid, strerror(errno))); in setPermissions()
190 static int copyRegular(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int … in copyRegular() argument
195 DBUG(("--- copying regular '%s' to '%s'\n", src, dst)); in copyRegular()
197 statResult = stat(dst, &dstStat); in copyRegular()
201 dst); in copyRegular()
204 fprintf(stderr, "acp: unable to stat destination '%s'\n", dst); in copyRegular()
211 src, dst); in copyRegular()
217 printNotNewerMsg(src, dst, options); in copyRegular()
231 DBUG(("--- opening '%s'\n", dst)); in copyRegular()
232 dstFd = open(dst, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0644); in copyRegular()
238 "acp: cannot create '%s': %s\n", dst, strerror(errno)); in copyRegular()
245 if (unlink(dst) != 0) { in copyRegular()
250 if (chmod(dst, S_IWRITE|S_IREAD) == 0 && unlink(dst) == 0) in copyRegular()
255 dst, strerror(errno)); in copyRegular()
262 dstFd = open(dst, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0644); in copyRegular()
267 dst, strerror(errno)); in copyRegular()
272 copyResult = copyFileContents(dst, dstFd, src, srcFd); in copyRegular()
289 dstRsrcName = malloc(strlen(dst) + 5 + 1); in copyRegular()
290 strcpy(dstRsrcName, dst); in copyRegular()
315 setPermissions(dst, pSrcStat, options); in copyRegular()
317 printCopyMsg(src, dst, options); in copyRegular()
332 static int copySymlink(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int … in copySymlink() argument
339 DBUG(("--- copying symlink '%s' to '%s'\n", src, dst)); in copySymlink()
342 statResult = lstat(dst, &dstStat); in copySymlink()
349 dst); in copySymlink()
356 src, dst); in copySymlink()
362 printNotNewerMsg(src, dst, options); in copySymlink()
376 DBUG(("--- creating symlink file '%s' (--> %s)\n", dst, linkBuf)); in copySymlink()
379 DBUG(("--- removing '%s'\n", dst)); in copySymlink()
380 if (unlink(dst) != 0) { in copySymlink()
382 dst, strerror(errno)); in copySymlink()
387 if (symlink(linkBuf, dst) != 0) { in copySymlink()
389 dst, linkBuf, strerror(errno)); in copySymlink()
398 if (lchown(dst, pSrcStat->st_uid, pSrcStat->st_gid) != 0) in copySymlink()
402 printCopyMsg(src, dst, options); in copySymlink()
412 int copyDirectory(const char* src, const char* dst, const struct stat* pSrcStat, unsigned int optio… in copyDirectory() argument
419 DBUG(("--- copy dir '%s' to '%s'\n", src, dst)); in copyDirectory()
421 statResult = stat(dst, &dstStat); in copyDirectory()
424 "acp: destination '%s' exists and is not a directory\n", dst); in copyDirectory()
427 fprintf(stderr, "acp: unable to stat destination '%s'\n", dst); in copyDirectory()
435 src, dst); in copyDirectory()
439 DBUG(("--- creating dir '%s'\n", dst)); in copyDirectory()
440 cc = mkdir(dst, 0755); in copyDirectory()
443 dst, strerror(errno)); in copyDirectory()
448 printCopyMsg(src, dst, options); in copyDirectory()
479 dstLen = strlen(dst); in copyDirectory()
487 memcpy(dstFile, dst, dstLen); in copyDirectory()
499 setPermissions(dst, pSrcStat, options); in copyDirectory()
511 static int copyFileRecursive(const char* src, const char* dst, bool isCmdLine, unsigned int options) in copyFileRecursive() argument
569 dstExe = malloc(strlen(dst) + 4 +1); in copyFileRecursive()
570 strcpy(dstExe, dst); in copyFileRecursive()
574 dst = dstExe; in copyFileRecursive()
600 retVal = copyDirectory(src, dst, &srcStat, options); in copyFileRecursive()
604 retVal = copySymlink(src, dst, &srcStat, options); in copyFileRecursive()
607 retVal = copyRegular(src, dst, &srcStat, options); in copyFileRecursive()
621 int copyFile(const char* src, const char* dst, unsigned int options) in copyFile() argument
623 return copyFileRecursive(src, dst, true, options); in copyFile()