lkml.org 
[lkml]   [2008]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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


\
 
 \ /
  Last update: 2008-06-02 10:17    [W:0.049 / U:1.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site