FidoNet Echomail Archive
aust_c_here

<<< Previous Index Next >>>

From: andrew clarke
To: Paul Edwards
Date: 1996-12-17 11:48:12
Subject: stat vs fstat

10 Dec 96 07:52, Paul Edwards wrote to All:

 > In MSGED, fstat() is called a few times (instead of stat).  Is there 
 > any disadvantage in converting all these calls to stat()?

Both are POSIX.1 and provide the same amount of error checking via their
return code and via the errno variable.  The only disadvantage I can think
of is that if you use open() to open a file and modify its contents, and in
the same bit of code you previously used fstat() get information on a file,
and you switch over to using stat(), you may end up opening the file twice
(either in succession or concurrently). 

--- Msged/2 4.10 beta 1
 * Origin: Blizzard of Ozz, Melbourne, Australia (3:635/728.4{at}fidonet)
SEEN-BY: 633/267 270

@PATH: 633/267


<<< Previous Index Next >>>