Greg Freemyer wrote:
On Fri, Aug 22, 2014 at 6:22 AM, Bernhard Voelker
wrote: On 08/21/2014 10:38 PM, Anton Aylward wrote:
Try
cat /tmp tr /tmp od -cb /tmp
Like dd these are all FILE operations. All give the same error: "Is a directory" That's what you get when you try running a file tool on a directory.
And that's the point: it's not a limitation in the tool - whatever the tool would do with such data - but rather a limit implied by the kernel. And the info page states this clearly:
`directory' Fail unless the file is a directory. Most operating systems do not allow I/O to a directory, so this flag has limited utility.
You can observe it with 'strace -v dd if=/tmp iflag=directory':
... open("/tmp", O_RDONLY|O_DIRECTORY) = 3 dup2(3, 0) = 0 close(3) = 0 lseek(0, 0, SEEK_CUR) = 0 ... read(0, 0x8e5000, 512) = -1 EISDIR (Is a directory)
If I remember correctly from +10 years ago, 'cat /some/dir' works on e.g. HP-UX, although the use is quite limited.
Have a nice day, Berny
Berny,
Why does dd have a flag option of nofollow? Why noatime? nofollow in particular seems crazy. If I don't want dd to work if "if" points at a symlink, then I shouldn't be calling dd on it in the first time.
Maybe if you're using dd in a script or loop, maybe in connection with find or some such.
My argument is that without an legitimate elucidation of the use case for "directory", "nofollow", and "noatime" they should be removed from dd and from the documentation for dd.
One could argue that their presence hasn't caused many problems sofar :-) -- Per Jessen, Zürich (21.5°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org