bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Phillip Susi
Subject: Re: dd new iflag= oflag= flags directory, nolinks
Date: Tue, 07 Mar 2006 10:01:27 -0500
User-agent: Thunderbird 1.5 (Windows/20051201)

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"....




reply via email to

[Prev in Thread] Current Thread [Next in Thread]