Dd uses O_RDWR because its skip() code falls back to read()ing the head of
the file if it can't lseek() to the position you want. IMHO that's not
necessary if you didn't give it any seek= option.
Patch to fileutils follows.
Index: src/dd.c
--- noris.6/src/dd.c Sun, 14 Dec 1997 15:33:37 +0100 smurf (gnu_fileutils/21_dd.c 1.2 644)
+++ noris.6(w)/src/dd.c Tue, 13 Apr 1999 10:05:49 +0200 smurf (gnu_fileutils/21_dd.c 1.2 644)
@@ -364,7 +364,7 @@
if (output_file != NULL)
{
- int omode = O_RDWR | O_CREAT;
+ int omode = (seek_record ? O_RDWR : O_WRONLY) | O_CREAT;
if (seek_record == 0 && !(conversions_mask & C_NOTRUNC))
omode |= O_TRUNC;
-- Matthias Urlichs | noris network GmbH | smurf@noris.de | ICQ: 20193661 The quote was selected randomly. Really. | http://www.noris.de/~smurf/-- If you think this is funny, look in a mirror.- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/