*/
#ifndef lint
-static char sccsid[] = "@(#)utilities.c 5.2 (Berkeley) 8/5/85";
+static char sccsid[] = "@(#)utilities.c 5.3 (Berkeley) 5/13/88";
#endif not lint
#include "restore.h"
renameit(from, to)
char *from, *to;
{
- if (rename(from, to) < 0) {
+ if (!Nflag && rename(from, to) < 0) {
fprintf(stderr, "Warning: cannot rename %s to %s", from, to);
(void) fflush(stderr);
perror("");
if (np->e_type != NODE)
badentry(np, "newnode: not a node");
cp = myname(np);
- if (mkdir(cp, 0777) < 0) {
+ if (!Nflag && mkdir(cp, 0777) < 0) {
np->e_flags |= EXISTED;
fprintf(stderr, "Warning: ");
(void) fflush(stderr);
ep->e_flags |= REMOVED;
ep->e_flags &= ~TMPNAME;
cp = myname(ep);
- if (rmdir(cp) < 0) {
+ if (!Nflag && rmdir(cp) < 0) {
fprintf(stderr, "Warning: ");
(void) fflush(stderr);
perror(cp);
ep->e_flags |= REMOVED;
ep->e_flags &= ~TMPNAME;
cp = myname(ep);
- if (unlink(cp) < 0) {
+ if (!Nflag && unlink(cp) < 0) {
fprintf(stderr, "Warning: ");
(void) fflush(stderr);
perror(cp);
{
if (type == SYMLINK) {
- if (symlink(existing, new) < 0) {
+ if (!Nflag && symlink(existing, new) < 0) {
fprintf(stderr,
"Warning: cannot create symbolic link %s->%s: ",
new, existing);
return (FAIL);
}
} else if (type == HARDLINK) {
- if (link(existing, new) < 0) {
+ if (!Nflag && link(existing, new) < 0) {
fprintf(stderr,
"Warning: cannot create hard link %s->%s: ",
new, existing);