bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rm documentation contains obsolete references to --directory (-d)


From: Paul Eggert
Subject: rm documentation contains obsolete references to --directory (-d)
Date: Wed, 02 Nov 2005 14:00:44 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

The rm documentation mentions the old --directory (-d) option, but
that's a noop now.

We should remove rm -d.  Or perhaps replace it with the FreeBSD
behavior?  FreeBSD "rm -d foo" behaves like remove("foo"), which in
turn is either unlink("foo") or rmdir("foo") depending on whether foo
is a directory.

Also, we should probably remove ln --directory (-d, -F) while we're
at it, no?  It has the same problem as the old rm -d.

In the meantime I installed the following patch on the mainline
branch.

2005-11-02  Paul Eggert  <address@hidden>

        * Version 6.0-cvs.

        * NEWS: Mention that rm -d and maybe ln -d are scheduled for
        removal in 2006.
        * doc/coreutils.texi (rm invocation): Don't mention --directory (-d).
        * src/remove.h (struct rm_options): Remove unlink_dirs.  All uses
        removed.
        * src/rm.c (usage): Don't mention rm -d.

Index: NEWS
===================================================================
RCS file: /fetish/cu/NEWS,v
retrieving revision 1.335
diff -p -u -r1.335 NEWS
--- NEWS        2 Nov 2005 09:58:43 -0000       1.335
+++ NEWS        2 Nov 2005 21:46:41 -0000
@@ -2,6 +2,18 @@ GNU coreutils NEWS                      
 
 * Major changes in release 6.0-cvs (????-??-??) [unstable]
 
+** Scheduled for removal
+
+  rm's --directory (-d) option is scheduled for removal in 2006.  This
+  option has been silently ignored since coreutils 5.0.  On systems
+  that support unlinking of directories, you can use the "unlink"
+  command to unlink a directory.
+
+  Similarly, we are considering the removal of ln's --directory (-d,
+  -F) option in 2006.  Please write to <address@hidden> if this
+  would cause a problem for you.  On systems that support hard links
+  to directories, you can use the "link" command to create one.
+
 ** New programs
 
   sha224sum: print or check a SHA224 (224-bit) checksum
@@ -12,7 +24,7 @@ GNU coreutils NEWS                      
 ** Bug fixes
 
   dircolors no longer segfaults upon an attempt to use the new
-  STICKY_OTHER_WRITABLE (OWT) attribute
+  STICKY_OTHER_WRITABLE (OWT) attribute.
 
   md5sum once again defaults to using the ` ' non-binary marker
   (rather than the `*' binary marker) by default on Unix-like systems.
@@ -23,7 +35,9 @@ GNU coreutils NEWS                      
   rm emits a better diagnostic when (without -r) it fails to remove
   a directory on e.g., Solaris 9/10 systems.
 
-  tac now works when stdin is a tty, even on non-Linux systems
+  The documentation no longer mentions rm's --directory (-d) option.
+
+  tac now works when stdin is a tty, even on non-Linux systems.
 
   "tail -c 2 FILE" and "touch 0101000000" now operate as POSIX
   1003.1-2001 requires, even when coreutils is conforming to older
Index: doc/coreutils.texi
===================================================================
RCS file: /fetish/cu/doc/coreutils.texi,v
retrieving revision 1.292
diff -p -u -r1.292 coreutils.texi
--- doc/coreutils.texi  1 Nov 2005 23:41:33 -0000       1.292
+++ doc/coreutils.texi  2 Nov 2005 21:46:46 -0000
@@ -7283,23 +7283,6 @@ The program accepts the following option
 
 @table @samp
 
address@hidden -d
address@hidden --directory
address@hidden -d
address@hidden --directory
address@hidden directories, removing with @code{unlink}
address@hidden unlink
address@hidden fsck
-Use the @code{unlink} function unconditionally rather than attempting
-to check whether the file is a directory and using @code{rmdir} if it
-is a directory.  This can be useful on corrupted file systems where
address@hidden works even though other, file-checking functions fail.
-For directories, this works
-only if you have appropriate privileges and if your operating system supports
address@hidden for directories.  Because unlinking a directory causes any files
-in the deleted directory to become unreferenced, it is wise to @command{fsck}
-the file system afterwards.
-
 @item -f
 @itemx --force
 @opindex -f
Index: src/remove.h
===================================================================
RCS file: /fetish/cu/src/remove.h,v
retrieving revision 1.14
diff -p -u -r1.14 remove.h
--- src/remove.h        14 May 2005 07:58:37 -0000      1.14
+++ src/remove.h        2 Nov 2005 21:46:46 -0000
@@ -1,6 +1,6 @@
 /* Remove directory entries.
 
-   Copyright (C) 1998, 2000, 2002, 2003, 2004 Free Software
+   Copyright (C) 1998, 2000, 2002, 2003, 2004, 2005 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -40,11 +40,6 @@ struct rm_options
   /* If nonzero, stdin is a tty.  */
   bool stdin_tty;
 
-  /* If true, remove directories with unlink instead of rmdir, and don't
-     require a directory to be empty before trying to unlink it.
-     Only works for the super-user.  */
-  bool unlink_dirs;
-
   /* If true, display the name of each file removed.  */
   bool verbose;
 
Index: src/mv.c
===================================================================
RCS file: /fetish/cu/src/mv.c,v
retrieving revision 1.170
diff -p -u -r1.170 mv.c
--- src/mv.c    3 Jul 2005 16:49:15 -0000       1.170
+++ src/mv.c    2 Nov 2005 21:46:46 -0000
@@ -92,7 +92,6 @@ static struct option const long_options[
 static void
 rm_option_init (struct rm_options *x)
 {
-  x->unlink_dirs = false;
   x->ignore_missing_files = false;
   x->root_dev_ino = NULL;
   x->recursive = true;
Index: src/rm.c
===================================================================
RCS file: /fetish/cu/src/rm.c,v
retrieving revision 1.135
diff -p -u -r1.135 rm.c
--- src/rm.c    29 Aug 2005 21:13:32 -0000      1.135
+++ src/rm.c    2 Nov 2005 21:46:47 -0000
@@ -137,9 +137,6 @@ usage (int status)
       fputs (_("\
 Remove (unlink) the FILE(s).\n\
 \n\
-  -d, --directory       unlink FILE, even if it is a non-empty directory\n\
-                          (super-user only; this works only if your system\n\
-                           supports `unlink' for nonempty directories)\n\
   -f, --force           ignore nonexistent files, never prompt\n\
   -i, --interactive     prompt before any removal\n\
 "), stdout);
@@ -179,7 +176,6 @@ truly unrecoverable, consider using shre
 static void
 rm_option_init (struct rm_options *x)
 {
-  x->unlink_dirs = false;
   x->ignore_missing_files = false;
   x->interactive = false;
   x->recursive = false;
@@ -214,7 +210,10 @@ main (int argc, char **argv)
       switch (c)
        {
        case 'd':
-         x.unlink_dirs = true;
+         /* Ignore this option, for backward compatibility with
+            coreutils 5.92.  Some time after 2005, we'll change this
+            to report an error (or perhaps behave like FreeBSD does)
+            instead of ignoring the option.  */
          break;
 
        case 'f':




reply via email to

[Prev in Thread] Current Thread [Next in Thread]