Hi
There is a problem with Cygwin and gpc-20030830, which is illustrated in this program:
program fbug; uses gpc; begin Writeln (FileExists ('fbug.pas')); Writeln (DirectoryExists ('.')); end.
In both cases, it prints "False", when indeed both the file and directory do exist. Checking filename.pas shows that both functions call "Stat", and I presume that this is where the problem lies - but I have no idea what do do about it.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
Guten Tag Prof A Olowofoyeku (The African Chief),
am Samstag, 22. November 2003 um 14:26 schrieben Sie:
PAOTAC> Hi
PAOTAC> There is a problem with Cygwin and gpc-20030830, which is illustrated PAOTAC> in this program:
PAOTAC> program fbug; PAOTAC> uses gpc; PAOTAC> begin PAOTAC> Writeln (FileExists ('fbug.pas')); PAOTAC> Writeln (DirectoryExists ('.')); PAOTAC> end.
PAOTAC> In both cases, it prints "False", when indeed both the file and PAOTAC> directory do exist. Checking filename.pas shows that both functions PAOTAC> call "Stat", and I presume that this is where the problem lies - but I PAOTAC> have no idea what do do about it.
$ ./stat.exe False True
Works for me(tm) with the Cygwin version. Package gcc-gpc-3.3.1.3 from: http://cygwin.com/setup.exe
Cygwin version 1.5.5-1, latest buildtools.
On 23 Nov 2003 at 3:11, Gerrit P. Haase wrote:
Guten Tag Prof A Olowofoyeku (The African Chief),
am Samstag, 22. November 2003 um 14:26 schrieben Sie:
PAOTAC> Hi
PAOTAC> There is a problem with Cygwin and gpc-20030830, which is illustrated PAOTAC> in this program:
PAOTAC> program fbug; PAOTAC> uses gpc; PAOTAC> begin PAOTAC> Writeln (FileExists ('fbug.pas')); PAOTAC> Writeln (DirectoryExists ('.')); PAOTAC> end.
PAOTAC> In both cases, it prints "False", when indeed both the file and PAOTAC> directory do exist. Checking filename.pas shows that both functions PAOTAC> call "Stat", and I presume that this is where the problem lies - but I PAOTAC> have no idea what do do about it.
$ ./stat.exe False True
Works for me(tm) with the Cygwin version. Package gcc-gpc-3.3.1.3 from: http://cygwin.com/setup.exe
Cygwin version 1.5.5-1, latest buildtools.
With your gpc binaries, based on gcc-3.3.1-3, it works correctly. With your gpc sources, my sources, and the pristine sources, built, on a freshly installed Cygwin, and based on gcc-3.2.3, it gives the result shown above. This is the first time that this error has shown up. I have traced down to the _p_Stat() function in rts.c, and I have ascertained that the error happens here, with respect to FileExists: The call: " if (Special) *Special = S_ISCHR (st.st_mode) || S_ISBLK (st.st_mode) || S_ISFIFO (st.st_mode) || S_ISSOCK (st.st_mode);"
returns 1. I don't know what "Special" means and why it is returning true here. But I doubt that that attribute has any significant meaning under Windows.
The DirectoryExists call fails here: " if (Dir) *Dir = S_ISDIR (st.st_mode);" This returns 0 if you pass any directory other than "/".
Is this a gcc-3.2.3 problem? I don't know - and I would doubt it. On the other hand, it obviously doesn't exist with your gcc-3.3.1-3 based binary.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/