Re: file system inconsistency



Tauno Voipio wrote:
Allan Adler wrote:

(4) I've been getting a little better at using gdb. Recently I noticed that
if I have a variable fp of type FILE * and I tell gdb to print *fp,
it prints a ton of information about the file, most of which I don't
understand but I've tried it on some small text files and seen the
text show up in some of the fields. So, that looks like it will be
fun to play with some more. If there are some exercises with gdb that
I can try on files, directories and inodes, I'd be glad to hear about them.

The file interface using FILE * is a link to the run-time C
library (level 2 I/O) and FILE * points to the internal data
of the library routines.

The library I/O functions are using the kernel I/O interface
which refers to an open channel with a handle number.

The inodes and directories are kernel internal structures, so
your question points to two different layers of the I/O system.
You cannot access them in the user mode debugger.

The OP might want to look into 'debugfs' if the filesystem in question is ext2 or ext3. As it's name suggests, it's a filesystem debugger.
.