This is a discussion on Re: new in rm within the mailing.openbsd.tech forums, part of the OpenBSD category; --> * Ray Lai (ray@cyth.net) wrote: > > continue; > > - else if (S_ISDIR(sb.st_mode)) > > - rval = ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| * Ray Lai (ray@cyth.net) wrote: > > continue; > > - else if (S_ISDIR(sb.st_mode)) > > - rval = rmdir(f); > > else { > > - if (Pflag) > > - if (!rm_overwrite(f, &sb)) > > - continue; > > - rval = unlink(f); > > + if (vflag) > > + printf("%s\n", f); > > + if (S_ISDIR(sb.st_mode)) > > + rval = rmdir(f); > > + else { > > + if (Pflag) > > + if (!rm_overwrite(f, &sb)) > > + continue; > > + rval = unlink(f); > > + } > > Why the additional level of indentation? > > And as djm@ suggested, ``It should probably print the file/directory > name *after* successfully removing it.'' > > > } look at the initial code, it was a "else if" condition, here i wanted to print the path in the else condition, then run the if else test. hence the code moved from before | after | if { | if { stmt1; | stmt1; } else if { | } else { stmt2; | additionnal_stmt; } else { | if { stmt3; | stmt2; } | } else { | stmt3; | } | } I'll move to post-removal printing anyway. > > .Fl R . > > +.Pp > > +.It Fl v > > +Print each file path before removal. Useful when removing large > > +directories. > > You don't need a .Pp right before a .It. > noted, thanks. |