[fpc-devel]fpStat() and LinuxError
Jeff Pohlmeyer
yetanothergeek at yahoo.com
Mon Dec 1 11:21:27 CET 2003
How do I get the error code for fpStat() ?
The oldlinux.stat() function returns FALSE on failure, and sets LinuxError.
The libc.stat() function returns (-1) on failure, and sets errno.
The baseunix.fpStat() function returns (-1) on failure,
but it does not set LinuxError.
If I call fpStat() on a non-existing file, "strace" shows
the error is ENOENT, but LinuxError is still zero.
( I am using 1.9.0 [2003/11/05] for i386/Linux )
program stat_test;
uses unix, baseunix, errors;
var
info: stat;
err: LongInt;
const
fn = 'nosuch.file';
begin
err:=fpStat(fn, info);
if ( err <> 0 ) then
begin
pError(fn, LinuxError); // Success ?
pError('Error', err); // (-1) ?
end;
end.
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
More information about the fpc-devel
mailing list