Messages in this thread | | | Date | Mon, 2 Jun 2008 10:14:28 +0200 | From | Jan Kara <> | Subject | Re: UBIFS seekdir()/telldir() issue |
| |
On Fri 30-05-08 13:57:45, Adrian Hunter wrote: > Jan Kara wrote: >> The sequence you write above is actually incorrect I think. Noone >> guarantees that the cookie returned by telldir() is valid after >> closedir(). What is a bigger (and quite common) problem is, if somebody >> uses readdir/telldir/seekdir while someone else creates/deletes files in >> the directory. The standard implies in this case that subsequent >> readdir should return all the files which were not touched (or all files >> after position set by seekdir if used...). > > Not according to this: > > http://www.opengroup.org/onlinepubs/009695399/functions/readdir.html > > "If a file is removed from or added to the directory after the > most recent call to opendir() or rewinddir(), whether a > subsequent call to readdir() returns an entry for that file > is unspecified." This is exactly what I meant. Maybe phrased it wrongly in my email :)
Honza -- Jan Kara <jack@suse.cz> SUSE Labs, CR
| |