Re: Documentation discrepancy for ls -f

2006-03-07 Thread Paul Eggert
[EMAIL PROTECTED] (Niels Möller) writes:

> while the message from ls --help says
>
>   -f do not sort, enable -aU, disable -lst
>
> This differs with respect to the -t and --color options. That -f
> disables --color seems to match the implementation.

Thanks for reporting that.  I installed the patch below.

> I think it would also be helpful to say something about what -f is
> intended to be used for and why the option character 'f' (force) is
> selected for that.

Sorry, I don't know that one.

> should I use bug-coreutils instead?

Yes, please.

2006-03-05  Paul Eggert  <[EMAIL PROTECTED]>

* src/ls.c (usage): Mention that -f disables --color.
Problem reported by Niels Möller.

--- ls.c26 Feb 2006 10:01:00 -  1.406
+++ ls.c6 Mar 2006 07:02:39 -   1.407
@@ -4152,7 +4152,7 @@ Mandatory arguments to long options are 
   -D, --diredgenerate output designed for Emacs' dired mode\n\
 "), stdout);
   fputs (_("\
-  -f do not sort, enable -aU, disable -lst\n\
+  -f do not sort, enable -aU, disable -ls --color\n\
   -F, --classify append indicator (one of */=>@|) to entries\n\
   --file-typelikewise, except do not append `*'\n\
   --format=WORD  across -x, commas -m, horizontal -x, long -l,\n\


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: dd new iflag= oflag= flags directory, nolinks

2006-03-07 Thread Phillip Susi
I'm confused.  You can't open() and write() to a directory, so how does 
it make any sense to ask dd to set O_DIRECTORY?


Paul Eggert wrote:

I wanted to use dd iflag=directory (to test whether a file is a
directory, atomically), and noticed that dd didn't have it.  The use
was a fairly obscure one (just testing the O_DIRECTORY flag) but I
figured dd should support all the flags.  I noticed also that dd
doesn't support the Solaris 10 O_NOLINKS option.  So I installed this:

2006-03-05  Paul Eggert  <[EMAIL PROTECTED]>

* doc/coreutils.texi (dd invocation): New flags directory, nolinks.
Alphabetize nofollow.
* src/dd.c (flags, usage): New flags directory, nolinks.
* src/system.h (O_NOLINKS): Define to 0 if not already defined.

Index: doc/coreutils.texi
===
RCS file: /fetish/cu/doc/coreutils.texi,v
retrieving revision 1.315
diff -p -u -r1.315 coreutils.texi
--- doc/coreutils.texi  27 Feb 2006 10:47:23 -  1.315
+++ doc/coreutils.texi  6 Mar 2006 07:15:27 -
@@ -7003,7 +7003,8 @@ argument(s).  (No spaces around any comm
 Access the output file using the flags specified by the @var{flag}
 argument(s).  (No spaces around any comma(s).)
 
-Flags:

+Here are the flags.  Not every flag is supported on every operating
+system.
 
 @table @samp
 
@@ -7019,6 +7020,13 @@ contents of the file.  This flag makes s

 @cindex direct I/O
 Use direct I/O for data, avoiding the buffer cache.
 
[EMAIL PROTECTED] directory

[EMAIL PROTECTED] directory
[EMAIL PROTECTED] directory I/O
+
+Fail unless the file is a directory.  Most operating systems do not
+allow I/O to a directory, so this flag has limited utility.
+
 @item dsync
 @opindex dsync
 @cindex synchronized data reads
@@ -7043,11 +7051,6 @@ Use non-blocking I/O.
 @cindex access time
 Do not update the file's access time.
 
[EMAIL PROTECTED] nofollow

[EMAIL PROTECTED] nofollow
[EMAIL PROTECTED] symbolic links, following
-Do not follow symbolic links.
-
 @item noctty
 @opindex noctty
 @cindex controlling terminal
@@ -7056,6 +7059,16 @@ This has no effect when the file is not 
 On many hosts (e.g., @acronym{GNU}/Linux hosts), this option has no effect

 at all.
 
[EMAIL PROTECTED] nofollow

[EMAIL PROTECTED] nofollow
[EMAIL PROTECTED] symbolic links, following
+Do not follow symbolic links.
+
[EMAIL PROTECTED] nolinks
[EMAIL PROTECTED] nolinks
[EMAIL PROTECTED] hard links
+Fail if the file has multiple hard links.
+
 @item binary
 @opindex binary
 @cindex binary I/O
Index: src/dd.c
===
RCS file: /fetish/cu/src/dd.c,v
retrieving revision 1.190
diff -p -u -r1.190 dd.c
--- src/dd.c7 Dec 2005 21:12:12 -   1.190
+++ src/dd.c6 Mar 2006 07:15:27 -
@@ -263,10 +263,12 @@ static struct symbol_value const flags[]
   {"append", O_APPEND},
   {"binary", O_BINARY},
   {"direct", O_DIRECT},
+  {"directory",  O_DIRECTORY},
   {"dsync",  O_DSYNC},
   {"noatime",O_NOATIME},
   {"noctty", O_NOCTTY},
   {"nofollow",   O_NOFOLLOW},
+  {"nolinks",O_NOLINKS},
   {"nonblock",   O_NONBLOCK},
   {"sync",   O_SYNC},
   {"text",   O_TEXT},
@@ -460,6 +462,8 @@ Each FLAG symbol may be:\n\
 "), stdout);
   if (O_DIRECT)
fputs (_("  directuse direct I/O for data\n"), stdout);
+  if (O_DIRECTORY)
+   fputs (_("  directory fail unless a directory\n"), stdout);
   if (O_DSYNC)
fputs (_("  dsync use synchronized I/O for data\n"), stdout);
   if (O_SYNC)
@@ -468,11 +472,13 @@ Each FLAG symbol may be:\n\
fputs (_("  nonblock  use non-blocking I/O\n"), stdout);
   if (O_NOATIME)
fputs (_("  noatime   do not update access time\n"), stdout);
-  if (O_NOFOLLOW)
-   fputs (_("  nofollow  do not follow symlinks\n"), stdout);
   if (O_NOCTTY)
fputs (_("  nocttydo not assign controlling terminal from file\n"),
   stdout);
+  if (O_NOFOLLOW)
+   fputs (_("  nofollow  do not follow symlinks\n"), stdout);
+  if (O_NOLINKS)
+   fputs (_("  nolinks   fail if multiply-linked\n"), stdout);
   if (O_BINARY)
fputs (_("  binaryuse binary I/O for data\n"), stdout);
   if (O_TEXT)
Index: src/system.h
===
RCS file: /fetish/cu/src/system.h,v
retrieving revision 1.143
diff -p -u -r1.143 system.h
--- src/system.h26 Feb 2006 10:03:17 -  1.143
+++ src/system.h6 Mar 2006 07:15:27 -
@@ -193,6 +193,10 @@ initialize_exit_failure (int status)
 # define O_NOFOLLOW 0
 #endif
 
+#if !defined O_NOLINKS

+# define O_NOLINKS 0
+#endif
+
 #if !defined O_RSYNC
 # define O_RSYNC 0
 #endif
  


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils