MCPcopy Create free account
hub / github.com/coreutils/coreutils / copy_file

Function copy_file

src/install.c:415–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413 was skipped. */
414
415static enum copy_status
416copy_file (char const *from, char const *to,
417 int to_dirfd, char const *to_relname, const struct cp_options *x)
418{
419 if (copy_only_if_needed && !need_copy (from, to, to_dirfd, to_relname, x))
420 return COPY_SKIPPED;
421
422 /* Allow installing from non-regular files like /dev/null.
423 Charles Karney reported that some Sun version of install allows that
424 and that sendmail's installation process relies on the behavior.
425 However, since !x->recursive, the call to "copy" will fail if FROM
426 is a directory. */
427
428 bool copy_into_self;
429 return (copy (from, to, to_dirfd, to_relname, 0, x, &copy_into_self, NULL)
430 ? COPY_OK : COPY_FAILED);
431}
432
433/* Set the attributes of file or directory NAME aka DIRFD+RELNAME.
434 Return true if successful. */

Callers 1

install_file_in_fileFunction · 0.85

Calls 2

need_copyFunction · 0.85
copyFunction · 0.85

Tested by

no test coverage detected