[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: iflag/oflag for dd(1)
> I want to put up my hand and say I don't see the point in treating dd
> differently from other utilities.
To take the opposing view: dd's purpose is different, so the treatment
it deserves is different.
> I can't think of another one that takes file-open flags, and I can
> think of many that open files (not least, /bin/sh) that don't.
True. I think it would be good to extend sh's redirection syntax to
allow specifying at least some of the flags from open(2).
> All the intended uses afaict could be accomplished by calling stat or
> test first.
I don't know about "intended". But...O_NOFOLLOW, O_SHLOCK, O_EXLOCK,
and O_DSYNC are immediately apparent, and I am not at all sure that
people won't come up with uses for others. This also allows (heading
towards) eliminating conv=notrunc, which never belonged in conv= anyway
(it's not a conversion). I think open(2) needs an O_REGONLY (which
would be to S_IFREG what O_DIRECTORY is to S_IFDIR), which would also
be useful with dd, but until it exists it's of no use.
> If you're tempted to say "race condition" I refer you to my prior
> observation: "foo <a >>b" accomplishes much the same thing more
I'm having trouble seeing how that helps with _any_ race, much less the
races that O_NOFOLLOW closes, never mind the O_xxLOCK ones.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse%rodents-montreal.org@localhost
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Main Index |
Thread Index |