I'm sure there's probably something in there, but you aren't supposed to
directly access any of those fields.  I can't think of any sneaky way to
get to the info (fstat/lstat don't seem to be much use here unless you
know a way to go from inode to filename).  An alternative is to create
your own structure that contains a FILE pointer and any other information
you want to track.  Then, in any functions you want to use the file, you'd
just need to add the dereference: mystruc->file


> Is there a field anywhere in that file structure that keeps track of the
> file's name?  In db.c where it's loading area data, it's got its various
> functions like fread_string and fread_word, and if something's screwy
> with the area file then they'll bug with something like "Word too long"
> but not tell you which file or where in the file, and I'd like to be
> able to log the file and the line and offset of what it was trying to
> read when that happened (I just happen to be going to db.c right now and
> the idea hit me, but I've no idea if that structure holds the filename
> info)... so that's my question... I don't think it does, or else a lot
> of coding examples I see on the internet, and probably the whole design
> of those functions originally would have included that kind of info, but
> there's no harm in asking :D Thanks in advance :)
>
> Richard Lindsey.
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>


Reply via email to