mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 01:29:28 +02:00
* FileExists fixed - wildcards not accepted any longer
git-svn-id: trunk@18846 -
This commit is contained in:
parent
8eafefc90f
commit
7f7a4518f7
@ -642,8 +642,9 @@ begin
|
||||
if FileName = '' then
|
||||
Result := false
|
||||
else
|
||||
Result := FileGetAttr (ExpandFileName (Directory)) and
|
||||
faDirectory = faDirectory;
|
||||
Result := FileGetAttr (ExpandFileName (FileName)) and
|
||||
(faDirectory or faVolumeID) = 0;
|
||||
(* Neither VolumeIDs nor directories are files. *)
|
||||
end;
|
||||
|
||||
|
||||
|
@ -285,18 +285,13 @@ end;
|
||||
|
||||
|
||||
Function FileExists (Const FileName : String) : Boolean;
|
||||
Var
|
||||
Sr : Searchrec;
|
||||
begin
|
||||
DOS.FindFirst(FileName,$3f,sr);
|
||||
if DosError = 0 then
|
||||
begin
|
||||
{ No volumeid,directory }
|
||||
Result:=(sr.attr and $18)=0;
|
||||
Dos.FindClose(sr);
|
||||
end
|
||||
if FileName = '' then
|
||||
Result := false
|
||||
else
|
||||
Result:=false;
|
||||
Result := FileGetAttr (ExpandFileName (FileName)) and
|
||||
(faDirectory or faVolumeID) = 0;
|
||||
(* Neither VolumeIDs nor directories are files. *)
|
||||
end;
|
||||
|
||||
|
||||
|
@ -612,16 +612,16 @@ end;
|
||||
|
||||
|
||||
function FileExists (const FileName: string): boolean;
|
||||
var
|
||||
SR: TSearchRec;
|
||||
RC: longint;
|
||||
begin
|
||||
FileExists:=False;
|
||||
if FindFirst (FileName, faAnyFile and not (faDirectory), SR) = 0
|
||||
then FileExists := True;
|
||||
FindClose(SR);
|
||||
if FileName = '' then
|
||||
Result := false
|
||||
else
|
||||
Result := FileGetAttr (ExpandFileName (FileName)) and
|
||||
(faDirectory or faVolumeID) = 0;
|
||||
(* Neither VolumeIDs nor directories are files. *)
|
||||
end;
|
||||
|
||||
|
||||
type TRec = record
|
||||
T, D: word;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user