summaryrefslogtreecommitdiff
path: root/bin/rm
Commit message (Collapse)AuthorAgeFilesLines
* When the P flag is set (i.e. Overwrite regular files before deleting them),Guido van Rooij2003-11-101-8/+14
| | | | | | | | | | | | do only unlink the file if we could indeed overwrite the file. Old behaviour: rm -P /tmp/foo (foo mode 0444) would NOT overwrite foo, but still delete it (with a warning: rm: foo: Permission denied) New behaviour: Just the EPERM warning, but no deletion Reviewed by: bde Notes: svn path=/head/; revision=122409
* 1. Fixed leakage of a file descriptor for every non-fatal failure inBruce Evans2003-11-081-1/+3
| | | | | | | | | | | | | | | | | | rm_overwrite() (for rm -P). 2. Print the file name in the error message for (fatal) malloc() failures in rm_overwrite(). I first thought that malloc() failures should be non-fatal since they don't prevent proceeding the the next file, but making them non-fatal would normally give too much output for rm -Pr on a large tree in the unlikely event that even one occurs, since the malloc()ed amounts are usually the same. Just print the file name since the malloc()ed amounts are not always the same and it doesn't hurt to know where rm was when it quit. Submitted by: guido ((1) and original version of (2)) Notes: svn path=/head/; revision=122304
* Quiet warnings about copyright[].David E. O'Brien2003-05-011-2/+2
| | | | Notes: svn path=/head/; revision=114433
* Cross ref chflags(1).Tom Rhodes2003-02-041-0/+1
| | | | | | | Suggested by: Craig Carey <research@ijs.co.nz) on -doc. Notes: svn path=/head/; revision=110347
* s/filesystem/file system/ as discussed on -developersTom Rhodes2002-08-212-4/+4
| | | | Notes: svn path=/head/; revision=102230
* Revert previous delta, which is not required with rev 1.5 ofSheldon Hearn2002-07-151-1/+0
| | | | | | | src/contrib/gcc/c-format.c . Notes: svn path=/head/; revision=100069
* Complain if more than one file argument is given to unlink(1) like we didTim J. Robbins2002-07-121-1/+1
| | | | | | | before I made unlink use getopt(). Notes: svn path=/head/; revision=99858
* Set WFORMAT=0, because our compiler currently complains about NULLSheldon Hearn2002-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | arg 2 to err() and friends, and warnings are promoted to errors. This allows the following revisions to be reverted: rev 1.39 src/bin/cp/cp.c rev 1.26 src/bin/chmod/chmod.c rev 1.40 src/bin/rm/rm.c The following revisions can already be reverted, because they were already covered by WFORMAT=0: rev 1.8 src/bin/ls/lomac.c rev 1.63 src/bin/ls/ls.c rev 1.8 src/bin/ps/lomac.c rev 1.34 src/bin/rcp/rcp.c Notes: svn path=/head/; revision=99767
* err() is documented as allowing NULL for the format string but GCC isn'tMatthew Dillon2002-07-101-2/+2
| | | | | | | happy about it any more so change the usage to make buildworld work again. Notes: svn path=/head/; revision=99744
* Consistently use FBSDIDDavid E. O'Brien2002-06-301-3/+2
| | | | Notes: svn path=/head/; revision=99110
* Reject options, handle "--" correctly in unlink(1).Tim J. Robbins2002-05-301-4/+7
| | | | Notes: svn path=/head/; revision=97533
* Consistancy check s/file system/filesystem/Tom Rhodes2002-05-162-4/+4
| | | | | | | Reviewed by: brian Notes: svn path=/head/; revision=96702
* Update STANDARDS section on rm(1) to reflect current conformance.Doug White2002-03-021-16/+2
| | | | | | | PR: 35471 Notes: svn path=/head/; revision=91555
* Move user_from_uid to pwd.hWarner Losh2002-02-141-0/+2
| | | | | | | | | | | | | | | | Move group_from_gid to grp.h Remove from stdlib.h Make the prototypes match the code Fix rm and mv to include new files. NetBSD has these defined in those files, and others too that I've not done. Approved by: terminal room kabal Reviewed by: jhb, phk Notes: svn path=/head/; revision=90644
* o __P has been reovedWarner Losh2002-02-021-23/+13
| | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. Notes: svn path=/head/; revision=90110
* Add prototypes for main() so that these programs compile with -WerrorLuigi Rizzo2001-12-141-0/+1
| | | | | | | | | | | | | | | (which somehow now seems to be the default for compiling -current). This error popped up while doing a PicoBSD cross-compile on a 4.3-ish system, it may well be that there are other apps which have similar problems, but I did not spot them as they are not included in my picobsd config. Whether adding prototypes for main() is the correct solution or not I have no idea, a request to -current on the matter went basically unanswered. Those who have better ideas are welcome to back this out and replace it with the correct fix. Notes: svn path=/head/; revision=87893
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyDavid E. O'Brien2001-12-041-1/+0
| | | | | | | | | set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87323
* Set WARNS=2 on programs which compile cleanly.Dima Dorfman2001-07-151-0/+1
| | | | | | | Submitted by: Mike Barcroft <mike@q9media.com> Notes: svn path=/head/; revision=79758
* Remove whitespace at EOL.Dima Dorfman2001-07-151-5/+5
| | | | Notes: svn path=/head/; revision=79754
* Removed wrong cast for fts_open()'s third argument.Ruslan Ermilov2001-06-131-1/+1
| | | | Notes: svn path=/head/; revision=78170
* mdoc(7) police: use the default ``file ...'' feature of the .Ar macro.Ruslan Ermilov2001-02-131-1/+1
| | | | Notes: svn path=/head/; revision=72432
* Display pathname of item being rm'ed.David E. O'Brien2000-12-201-3/+3
| | | | | | | Submitted by: Peter Pentchev <roam@orbitel.bg> Notes: svn path=/head/; revision=70219
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-151-1/+1
| | | | Notes: svn path=/head/; revision=70056
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-2/+2
| | | | Notes: svn path=/head/; revision=68935
* Switch over to using the new fflagstostr and strtofflags library calls.Josef Karthauser2000-06-172-10/+7
| | | | Notes: svn path=/head/; revision=61749
* Remove unused #include.Jeroen Ruigrok van der Werven2000-05-011-1/+0
| | | | Notes: svn path=/head/; revision=59863
* Revert part of the last commit, remove {g|s}etflags from the libcJosef Karthauser2000-02-052-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | interface, and statically link them to the programs using them. These functions, upon reflection and discussion, are too generically named for a library interface with such specific functionality. Also the api that they use, whilst ok for private use, isn't good enough for a libc function. Additionally there were complications with the build/install-world process. It depends heavily upon xinstall, which got broken by the change in api, and caused bootstrap problems and general mayhem. There is work in progress to address future problems that may be caused by changes in install-chain tools, and better names for {g|s}etflags can be derived when some future program requires them. For now the code has been left in src/lib/libc/gen (it started off in src/bin/ls). It's important to provide library functions for manipulating file flag strings if we ever want this interface to be adopted outside of the source tree, but now isn't necessarily the right moment with 4.0-release just around the corner. Approved: jkh Notes: svn path=/head/; revision=57003
* Historically file flags (schg, uschg, etc) have been converted fromJosef Karthauser2000-01-272-5/+1
| | | | | | | | | | | | | | | | | | | | string to u_long and back using two functions, flags_to_string and string_to_flags, which co-existed with 'ls'. As time has progressed more and more other tools have used these private functions to manipulate the file flags. Recently I moved these functions from /usr/src/bin/ls to libutil, but after some discussion with bde it's been decided that they really ought to go in libc. There are two already existing libc functions for manipulating file modes: setmode and getmode. In keeping with these flags_to_string has been renamed getflags and string_to_flags to setflags. The manual page could probably be improved upon ;) Notes: svn path=/head/; revision=56692
* Actually remove unrequired SRCS.Bruce Evans2000-01-051-1/+0
| | | | Notes: svn path=/head/; revision=55476
* Added missing DPADD's. Removed unrequired SRCS's.Josef Karthauser2000-01-011-0/+1
| | | | | | | Obtained from: bde Notes: svn path=/head/; revision=55302
* Moved flags_to_string and string_to_flags into libutil. It's used inJosef Karthauser1999-12-301-3/+2
| | | | | | | many places nowadays. Notes: svn path=/head/; revision=55270
* Fix cut'n'paste niggles in previous commit.Sheldon Hearn1999-12-211-6/+7
| | | | Notes: svn path=/head/; revision=54943
* Add link(1) and unlink(1) as special cases of ln(1) and rm(1)Sheldon Hearn1999-12-203-2/+42
| | | | | | | | | | | | | | | respectively, in accordance with SUSv2. This differs from the approach taken in NetBSD, but provides less obscure error messages in at least the EISDIR case and does not take up additional disk space for new binaries. PR: 13071 PR: 13074 Requested by: James Howard <howardjp@wam.umd.edu> Notes: svn path=/head/; revision=54895
* brucifyMichael Haro1999-11-281-13/+13
| | | | | | | Reviewed by: obrien Notes: svn path=/head/; revision=53819
* Fixed longstanding breakage of rm of deep directories in rev.1.2.Bruce Evans1999-09-131-1/+1
| | | | | | | | | | | | | rm must not use FTS_NOCHDIR, since chdir'ing is required for removing deep directory trees and the ability to remove such trees is required by POSIX.2 and POLA. The breakage didn't make much difference until recently, since fts(3) didn't work in deep directory trees. It isn't clear whether using FTS_NOCHDIR ever fixed anything (Net/2's rm.c is similar to Lite1's). Perhaps it was actually to limit the damage caused by the fts bug. Notes: svn path=/head/; revision=51230
* brucify, `v' before `W', mention -v is non-standard in manpage andMichael Haro1999-09-042-18/+25
| | | | | | | | | make code slightly easier to read Reviewed by: obrien Notes: svn path=/head/; revision=50872
* fix rm -rMichael Haro1999-08-291-1/+2
| | | | | | | Submitted by: John Hay -- John.Hay@mikom.csir.co.za Notes: svn path=/head/; revision=50593
* add verbose flagMichael Haro1999-08-292-10/+27
| | | | | | | | | exit(1) --> exit(EX_USAGE) Reviewed by: obrien Notes: svn path=/head/; revision=50539
* $Id$ -> $FreeBSD$Peter Wemm1999-08-273-3/+3
| | | | Notes: svn path=/head/; revision=50471
* Use .Dq instead of ``'' in manpageKris Kennaway1999-05-282-8/+23
| | | | | | | | | | Use optimal blocksize for rm -P, instead of always using 8192-byte blocks to overwrite the file. Obtained from: OpenBSD Notes: svn path=/head/; revision=47584
* Don't emit usage() message when no arguments given to -f. ThisJordan K. Hubbard1999-02-251-2/+5
| | | | | | | | | | appears to be consistent with other Unixen, like Solaris. PR: 10240 Submitted by: jun_sun@hlla.is.tsukuba.ac.jp Notes: svn path=/head/; revision=44282
* Fix synopsis to match 1003.2. Add text describing the way in whichGarrett Wollman1999-01-281-10/+19
| | | | | | | | our implementation does not meet 1003.2 (rather than the now outdated ``is expected to comply' language). Notes: svn path=/head/; revision=43352
* .Nm rm -> .Nm.Philippe Charnier1998-05-181-8/+8
| | | | Notes: svn path=/head/; revision=36146
* Remove remaining Lite1 stuff from the man page and uphold theSteve Price1997-08-072-10/+9
| | | | | | | | | | precedence in changing sccsid to rcsid as set by Phillippe Charnier in his previous 100 or so commits. pointed out by: Bruce Evans <bde@zeta.org.au> Notes: svn path=/head/; revision=27964
* Remove #if(n)def BSD_4_4_LITE cruft and change sccsid to rcsid.Steve Price1997-08-071-46/+5
| | | | Notes: svn path=/head/; revision=27959
* Enable whiteout code since we now have the lite2 support for them.Doug Rabson1997-04-292-4/+4
| | | | Notes: svn path=/head/; revision=25280
* Provide examples of how to remove file names that begin withMike Pritchard1997-04-091-1/+8
| | | | | | | | | | | a dash in non-getopt implementations. E.g.: rm /home/mpp/-filename rm ./-filename Requested by: bde Notes: svn path=/head/; revision=24735
* Improve the wording in the NOTES section. Closes PR# 3223.Mike Pritchard1997-04-081-13/+12
| | | | Notes: svn path=/head/; revision=24731
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-281-3/+3
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24348
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-223-3/+3
| | | | Notes: svn path=/head/; revision=22988