Re: If not readdir() then what?
- From: Theodore Tso <tytso@xxxxxxx>
- Date: Sun, 8 Apr 2007 21:44:26 -0400
On Sun, Apr 08, 2007 at 12:28:32PM -0700, H. Peter Anvin wrote:
Theodore Tso wrote:
It doesn't state explicitly that you can use the telldir cookie()
after closing the directory stream using closedir() and then reopening
it using opendir(), but given that it states that results are
undefined after a rewinddir() --- which is much less violent than a
closedir()/opendir(), I would definitely argue that an application
programmer would be very ill-advised to rely on this working.
(Of course, I'd argue that an application programmer shouldn't use
telldir/seekdir at all.....)
Ulrich, is it too late to insert a clarification that the telldir()
cookie isn't guaranteed to be valid after closedir() *or* rewinddir()?
More fundamentally, the telldir cookie should never be valid when
applied to a different DIR * (even one that refers to the same directory.)
Well, Joern thought that rm -rf might relying on the telldir cookie
being valid in precisely that circumstance. If that is true, I'd
argue that this is a BUG in GNU coreutils that should be fixed...
- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: If not readdir() then what?
- From: Jörn Engel
- Re: If not readdir() then what?
- References:
- If not readdir() then what?
- From: Ulrich Drepper
- Re: If not readdir() then what?
- From: Theodore Tso
- Re: If not readdir() then what?
- From: Christoph Hellwig
- Re: If not readdir() then what?
- From: H. Peter Anvin
- Re: If not readdir() then what?
- From: Jörn Engel
- Re: If not readdir() then what?
- From: Theodore Tso
- Re: If not readdir() then what?
- From: H. Peter Anvin
- If not readdir() then what?
- Prev by Date: Re: [PATCH] Re: kernel oops with badly formatted module option
- Next by Date: Re: [linux-usb-devel] HID bus prototype - 20070408
- Previous by thread: Re: If not readdir() then what?
- Next by thread: Re: If not readdir() then what?
- Index(es):
Relevant Pages
|