On Mon, 21 Mar 2005, Jan Engelhardt wrote:

Hello list,


how can I invalidate all buffered/cached dentries so that ls -l /somefolder will definitely go read the harddisk?


fsync() on the file(s) in the directory then fsync() on the directory itself. For this, one can open the directory as though it was just a file, you don't need opendir().

FYI, this is what `man fsync` promises. It may be broken. Last
time I checked, one needed to umount() the file-system to make
sure the directories were updated. The problem may be that
somebody can have either the directory or a file within it
open. Until they get out, the directory entry may not actually
be finalized. Oh,... Unix/Linux doesn't have "folders". That's
some M$ thing. Real operating systems have directories. Your
GUI may have folders, just like it may have little houses,
trash-cans, red hats, and other odd widgets. However, the
operating system doesn't.


Jan Engelhardt --


Cheers,
Dick Johnson
Penguin : Linux version 2.6.11 on an i686 machine (5537.79 BogoMips).
 Notice : All mail here is now cached for review by Dictator Bush.
                 98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to