[fpc-pascal]Bug in S_ISDIR of fpc 1.0.10?
Tobias.D at t-online.de
Mon Aug 25 16:37:27 CEST 2003
Hope that's the right place for such things ;)
I've written a program using the LINUX unit, that looks through a
directory tree using the code-snipplet below. The purpose is to find the
subdirectories of the dir and then search in them, performing the same
The problem I encountered is, that some of the found directories are in
fact no dirs at all, and some other dirs aren't found. After some days
of searching for the buggy place I didn't find it, when I check those
files and dirs using "ls -l" the dirs are mod 755 and the files 644.
Is there a bug in S_ISDIR respectively in the FSTAT call or is something
wrong with my filesystem?
[begin code snipplet from "getfiles" procedure]
dirs := Glob('*');
if LinuxError = 0 then
while dirs <> nil do begin
fstat (dirs^.name, info);
if not (dirs^.name = '.') then begin
if S_ISDIR(info.mode) then begin
if RunInDebug then writeln(' > checking ', dirs^.name);
getfiles(dir + dirs^.name);
if RunInDebug then writeln(' > skipping ', dirs^.name);
dirs := dirs^.next;
[end code snipplet]
http://tobias.d.bei.t-online.de/ -=- PGP User ID: 0x825CE007
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the fpc-pascal