On 08/22/2014 05:13 PM, Greg Freemyer wrote:
Why does dd have a flag option of nofollow? Why noatime?
I've never noticed either of them before this discussion, but they seem foreign to a tool like dd.
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.
As noatime, that's a great option for a tree walking backup tool, but why in world does it make sense for dd.
Well, the difference is that it opens the input file differently: open("x", O_RDONLY|O_NOATIME) = 3 vs. open("x", O_RDONLY) = 3 POSIX [1] doesn't specify 'iflag' at all, so this is a GNU extension. [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html 'noatime' and 'nofollow' support has been added in 2005/2006 in version v6.0 without long commit message. But as you know from other flags, dd(1) is quite a low-level-I/O user- land tool, so it has many fine-grained options which are directly passed to low-level glibc functions like read(2), open(2), write(2), etc.
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.
Well, 'directory' may be helpful on systems that support it. 'nofollow' is a nice trick to prevent reading thru a symlink, and 'noatime' is just another possible flag used by open(2). dd(1) is a sophisticated Swiss-army knife with many low-level knobs. Admittedly, the texinfo manual could have more examples, yet the sheer number of combinations would make it impossible to add an example for every use case. Of course, everyone is invited to make proposals to enhance the docs, and I will try to carry them to upstream if possible. Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org