Sign in Join

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

Mailing lists / fpc-devel / 2005-10

Patch to sysutils.FileExists (win32)

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Luiz Américo

While dealing with DirectoryExists bug, i noticed some misbehaviors from FileExists.
This patch implements FileExists that has the following advantages compared with the current implementation:

1 - Return false when the argument is a directory (like Delphi) 2 - Return false when passing '*' as argument (like Delphi) 3 - Its faster

It also modifies SetCurrentDir, CreateDir, RemoveDir to call the native win32 api function directly instead of calling indirectly through ChDir, MkDir and RmDir

Luiz

Reply by email

Luiz Américo
to Luiz Américo
Luiz Américo wrote 12 lines
While dealing with DirectoryExists bug, i noticed some misbehaviors from FileExists. This patch implements FileExists that has the following advantages compared with the current implementation: 1 - Return false when the argument is a directory (like Delphi) 2 - Return false when passing '*' as argument (like Delphi) 3 - Its faster It also modifies SetCurrentDir, CreateDir, RemoveDir to call the native win32 api function directly instead of calling indirectly through ChDir, MkDir and RmDir

Any comments about the patch?

Luiz

Reply by email

Florian Klaempfl
to Luiz Américo
Luiz Américo wrote 17 lines
Luiz Américo wrote: > While dealing with DirectoryExists bug, i noticed some misbehaviors > from FileExists. > This patch implements FileExists that has the following advantages > compared with the current implementation: > > 1 - Return false when the argument is a directory (like Delphi) > 2 - Return false when passing '*' as argument (like Delphi) > 3 - Its faster > > It also modifies SetCurrentDir, CreateDir, RemoveDir to call the > native win32 api function directly instead of calling indirectly > through ChDir, MkDir and RmDir Any comments about the patch?

Sorry, I'd no time to look at it yet.

Reply by email

Florian Klaempfl
to Luiz Américo: While dealing with DirectoryExists bug, i noticed some misbehaviors from FileExists. This…
Luiz Américo wrote 12 lines
While dealing with DirectoryExists bug, i noticed some misbehaviors from FileExists. This patch implements FileExists that has the following advantages compared with the current implementation: 1 - Return false when the argument is a directory (like Delphi) 2 - Return false when passing '*' as argument (like Delphi) 3 - Its faster It also modifies SetCurrentDir, CreateDir, RemoveDir to call the native win32 api function directly instead of calling indirectly through ChDir, MkDir and RmDir

Applied, thx.

Reply by email