Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-04

Unexpexted result of FindFirst with 2.2.4

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Stefan Kisdaroczi

Hi all,

FindFirst from fpc 2.2.4 returns zero (file found) and an empty Name if I search for files in a empty directory. With fpc 2.2.2 FindFirst returns -1 as expected.

Im using Debian Lenny (i386) and installed the 2.2.4 *.deb's from the freepascal ftp site.

The following program is quiet with fpc 2.2.2, with 2.2.4 the output is: Found: Len=0

Can someone please confirm this. Thank you.
greetings kisda

program fpc_find;
uses sysutils;
var SearchRec : TSearchRec;
begin
  if ( FindFirst('./empty_dir/*', faAnyFile - faDirectory, SearchRec ) = 0 ) then
  with SearchRec do
    writeln( 'Found : ', Name,' Len=', length(Name) );
  FindClose( SearchRec );
end.

(dont forget: mkdir ./empty_dir)

Reply by email

Jonas Maebe
to Stefan Kisdaroczi
Stefan Kisdaroczi wrote 12 lines
FindFirst from fpc 2.2.4 returns zero (file found) and an empty Name if I search for files in a empty directory. With fpc 2.2.2 FindFirst returns -1 as expected. Im using Debian Lenny (i386) and installed the 2.2.4 *.deb's from the freepascal ftp site. The following program is quiet with fpc 2.2.2, with 2.2.4 the output is: Found: Len=0 Can someone please confirm this. Thank you.

I can confirm this behaviour, but it has been fixed already in 2.3.1 in the mean time.

Jonas

Reply by email

Unknown author
to Jonas Maebe
Jonas Maebe wrote 19 lines
On 21 Apr 2009, at 16:47, Stefan Kisdaroczi wrote: > FindFirst from fpc 2.2.4 returns zero (file found) and an empty Name > if I search for files in a empty directory. > With fpc 2.2.2 FindFirst returns -1 as expected. > > Im using Debian Lenny (i386) and installed the 2.2.4 *.deb's from > the freepascal ftp site. > > The following program is quiet with fpc 2.2.2, with 2.2.4 the output > is: > Found: Len=0 > > Can someone please confirm this. Thank you. I can confirm this behaviour, but it has been fixed already in 2.3.1 in the mean time. Jonas

I'm using fpc 2.2.5 Linux (2009-03-06). Seems to be working okay in respect to above. I'm busy downloading the fpc 2.2.4 stable as we speak. Should I hold the upgrade?

Nino

_______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jonas Maebe
to Unknown author
Show quoted text 22 lines
On Sunday 10 May 2009 14:41:06 Jonas Maebe wrote: > On 21 Apr 2009, at 16:47, Stefan Kisdaroczi wrote: >> FindFirst from fpc 2.2.4 returns zero (file found) and an empty Name >> if I search for files in a empty directory. >> With fpc 2.2.2 FindFirst returns -1 as expected. >> >> Im using Debian Lenny (i386) and installed the 2.2.4 *.deb's from >> the freepascal ftp site. >> >> The following program is quiet with fpc 2.2.2, with 2.2.4 the output >> is: >> Found: Len=0 >> >> Can someone please confirm this. Thank you. > > I can confirm this behaviour, but it has been fixed already in 2.3.1 > in the mean time. > I'm using fpc 2.2.5 Linux (2009-03-06). Seems to be working okay in respect to above.

That would be quite strange, since the bug was (I think) introduced in 2.2.x on 2008-11-14, and the fix has not been merged to 2.2.5.

I'm busy downloading the fpc 2.2.4 stable as we speak. Should I hold the upgrade?

In general, going from 2.2.5 to 2.2.4 would be considered a downgrade rather than an upgrade (although 2.2.4 was released after 2009-03-06 and a security fix was merged into 2.2.4 after that date). No changes related to findfirst/findnext were done anymore though.

Jonas

Reply by email

Unknown author
to Jonas Maebe

Hi Jonas

I''l stay with fpc 2.2.5 for the time being.

I have noticed that Lazarus (Linux version) has downgraded from fpc 2.2.5 to 2.2.4 in their daily snapshots though.

Thanks
Nino

//*************************************************
Jonas Maebe wrote 39 lines
On 10 May 2009, at 15:10, wrote: > On Sunday 10 May 2009 14:41:06 Jonas Maebe wrote: >> On 21 Apr 2009, at 16:47, Stefan Kisdaroczi wrote: >>> FindFirst from fpc 2.2.4 returns zero (file found) and an empty Name >>> if I search for files in a empty directory. >>> With fpc 2.2.2 FindFirst returns -1 as expected. >>> >>> Im using Debian Lenny (i386) and installed the 2.2.4 *.deb's from >>> the freepascal ftp site. >>> >>> The following program is quiet with fpc 2.2.2, with 2.2.4 the output >>> is: >>> Found: Len=0 >>> >>> Can someone please confirm this. Thank you. >> >> I can confirm this behaviour, but it has been fixed already in 2.3.1 >> in the mean time. > > I'm using fpc 2.2.5 Linux (2009-03-06). Seems to be working okay in > respect to > above. That would be quite strange, since the bug was (I think) introduced in 2.2.x on 2008-11-14, and the fix has not been merged to 2.2.5. > I'm busy downloading the fpc 2.2.4 stable as we speak. Should I hold > the upgrade? In general, going from 2.2.5 to 2.2.4 would be considered a downgrade rather than an upgrade (although 2.2.4 was released after 2009-03-06 and a security fix was merged into 2.2.4 after that date). No changes related to findfirst/findnext were done anymore though. Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Vincent Snijders
to Unknown author
Show quoted text 7 lines
Hi Jonas I''l stay with fpc 2.2.5 for the time being. I have noticed that Lazarus (Linux version) has downgraded from fpc 2.2.5 to 2.2.4 in their daily snapshots though.

That is because we prefer to create snapshots for fpc releases to be able to isolate Lazarus regressions from fpc regressions. Using fpc 2.2.2 was not possible because of mistakes in the gtk2 units supplied by fpc. So the snapshots switched to the fpc fixes branch (fpc 2.2.3 and 2.2.5) temporarily, but return the the latest release after the fpc 2.2.4 release.

Vincent
Lazarus snapshot builder

Reply by email

Unknown author
to Vincent Snijders
Vincent Snijders wrote 17 lines
schreef: > Hi Jonas > > I''l stay with fpc 2.2.5 for the time being. > > I have noticed that Lazarus (Linux version) has downgraded from fpc 2.2.5 > to 2.2.4 in their daily snapshots though. That is because we prefer to create snapshots for fpc releases to be able to isolate Lazarus regressions from fpc regressions. Using fpc 2.2.2 was not possible because of mistakes in the gtk2 units supplied by fpc. So the snapshots switched to the fpc fixes branch (fpc 2.2.3 and 2.2.5) temporarily, but return the the latest release after the fpc 2.2.4 release. Vincent Lazarus snapshot builder

Hi Vincent

I couldn't build gtk2 apps. That's the reason I used fpc 2.2.5. I'm downloading the latest Lazarus snapshots now.

Thanks for all your efforts.
Nino

_______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Stefan Kisdaroczi
to Jonas Maebe: I can confirm this behaviour, but it has been fixed already in 2.3.1 in the mean time.…
Show quoted text 17 lines
On 21 Apr 2009, at 16:47, Stefan Kisdaroczi wrote: > FindFirst from fpc 2.2.4 returns zero (file found) and an empty Name > if I search for files in a empty directory. > With fpc 2.2.2 FindFirst returns -1 as expected. > > Im using Debian Lenny (i386) and installed the 2.2.4 *.deb's from the > freepascal ftp site. > > The following program is quiet with fpc 2.2.2, with 2.2.4 the output is: > Found: Len=0 > > Can someone please confirm this. Thank you. I can confirm this behaviour, but it has been fixed already in 2.3.1 in the mean time.

Thank you for fixing this, Jonas.

I patched my 2.2.4 with your 2.3.1 changes (trunk, r13074) and it works fine now. I have attached a cleanly applying patch for 2.2.4, if someone else needs it.

Kisda

Reply by email