Lines Matching refs:target
53 static bool wflag; /* Warn if symlink target does not
145 case 2: /* ln source target */
155 * the target--simulate "not a directory" error
216 linkit(const char *source, const char *target, bool isdir)
241 * If the target is a directory (and not a symlink if hflag),
245 (lstat(target, &sb) == 0 && S_ISDIR(sb.st_mode)) ||
246 (!hflag && stat(target, &sb) == 0 && S_ISDIR(sb.st_mode)))) {
249 snprintf(path, sizeof(path), "%s/%s", target, p) >=
255 target = path;
271 * to the parent directory of the target.
273 strlcpy(bbuf, target, sizeof(bbuf));
287 exists = lstat(target, &sb) == 0;
289 if (!sflag && samedirent(source, target)) {
291 source, target);
301 if (rmdir(target)) {
302 warn("%s", target);
305 } else if (unlink(target)) {
306 warn("%s", target);
311 fprintf(stderr, "replace %s? ", target);
322 if (rmdir(target)) {
323 warn("%s", target);
326 } else if (unlink(target)) {
327 warn("%s", target);
333 if (sflag ? symlink(source, target) :
334 linkat(AT_FDCWD, source, AT_FDCWD, target,
336 warn("%s", target);
340 (void)printf("%s %c> %s\n", target, linkch, source);