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

Function writable_destination

src/copy.c:1404–1410  ·  view source on GitHub ↗

Return whether DST_DIRFD+DST_RELNAME, with mode MODE, is writable in the sense of 'mv'. Always consider a symbolic link to be writable. */

Source from the content-addressed store, hash-verified

1402 is writable in the sense of 'mv'.
1403 Always consider a symbolic link to be writable. */
1404static bool
1405writable_destination (int dst_dirfd, char const *dst_relname, mode_t mode)
1406{
1407 return (S_ISLNK (mode)
1408 || can_write_any_file ()
1409 || faccessat (dst_dirfd, dst_relname, W_OK, AT_EACCESS) == 0);
1410}
1411
1412static bool
1413overwrite_ok (struct cp_options const *x, char const *dst_name,

Callers 2

overwrite_okFunction · 0.85
abandon_moveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected