[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [leafnode-list] fetchnews fails to download bodies
Larry Jones wrote:
> On many systems, stat() is actually implemented as open(), fstat(), close().
In my case, I have the problem that I opened the file with fopen()
instead of open(). What is the proper way to stat a stream? My
suggestion which may be completely wrong:
FILE *f;
struct stat st;
f = fopen( "filename", "r" );
fstat(fileno(f), &st);
However, I don't know whether fileno() is a universally accepted function -
the man page would indicate not.
On a more general note, in which cases would it be preferable to use
open()/close()/... and in which cases would it be preferable to use
fopen()/fclose()/... instead?
--Cornelius.
--
/* Cornelius Krasel, U Wuerzburg, Dept. of Pharmacology, Versbacher Str. 9 */
/* D-97078 Wuerzburg, Germany email: krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* "Science is the game we play with God to find out what His rules are." */
--
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list