[Top][All Lists]

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

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

From: Paul Eggert
Subject: Re: dd new iflag= oflag= flags directory, nolinks
Date: Wed, 08 Mar 2006 01:04:14 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Phillip Susi <address@hidden> writes:

> 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?

No, because "test -d foo && test -r foo" is _two_ invocations of
"test", not one.  A race condition is therefore possible.  The race
condition is not possible with dd if=foo iflag=directory count=0.

Admittedly this usage is unusual.  The main arguments for it are
(1) "dd" supports all the other O_* flags, so why not O_DIRECTORY? and
(2) I ran into a situation where I could use O_DIRECTORY.
(1) is far more important than (2).

reply via email to

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