What is atomic about having dd do this? open() with O_DIRECTORY to test for existence of a directory is exactly what test does isn't it? If your goal is to test for the existence of a directory then test is what you want to use, not dd. The purpose of dd is to copy/convert data between devices, not test if files or directories exist, so I don't think this patch is very appropriate.
Paul Eggert wrote:
You can open a directory without writing to it.  Something like this:

   $ mkdir foo
   $ dd if=foo iflag=directory count=0
   0+0 records in
   0+0 records out
   0 bytes (0 B) copied, 2e-05 seconds, 0 B/s

You can think of this as a way to do a "test -d foo && test -r foo"
atomically, without race conditions.  Admittedly this is somewhat
twisted, but the new documentation does say that iflag=directory is of
"limited utility"....


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

Reply via email to