* Some more fixes.

This commit is contained in:
michael 1999-05-14 22:19:34 +00:00
parent 4571b76759
commit 20ffcd4e39

View File

@ -100,7 +100,7 @@ Function LinuxToWinAttr (FN : Char; Const Info : Stat) : Longint;
begin begin
Result:=0; Result:=faArchive;
If FN='.' then If FN='.' then
Result:=Result or faHidden; Result:=Result or faHidden;
If (Info.Mode and STAT_IFDIR)=STAT_IFDIR then If (Info.Mode and STAT_IFDIR)=STAT_IFDIR then
@ -118,7 +118,7 @@ end;
If FileAttributes match, the entry is reused If FileAttributes match, the entry is reused
} }
Function GlobToTSearchRec (Info : TSearchRec) : Boolean; Function GlobToTSearchRec (Var Info : TSearchRec) : Boolean;
Var SInfo : Stat; Var SInfo : Stat;
p : Pglob; p : Pglob;
@ -127,34 +127,37 @@ Var SInfo : Stat;
begin begin
TAttr:=$ffffffff; TAttr:=$ffffffff;
P:=pglob(Info.FindHandle); P:=pglob(Info.FindHandle);
Result:=Fstat(p^.name,SInfo); Result:=P<>Nil;
Info.FindHandle:=Longint(P^.Next);
P^.Next:=Nil;
GlobFree(P);
If Result then If Result then
begin begin
Info.Attr:=LinuxToWinAttr(p^.name[0],SInfo); Info.FindHandle:=Longint(P^.Next);
Result:=(Info.ExcludeAttr and TAttr)<>0 ; Result:=Fstat(p^.name,SInfo);
If Result Then If Result then
With Info do begin
begin Info.Attr:=LinuxToWinAttr(p^.name[0],SInfo);
Attr:=Info.Attr; Result:=(Info.ExcludeAttr and TAttr)<>0;
Name:=strpas(p^.name); If Result Then
Time:=Sinfo.mtime; With Info do
Size:=Sinfo.Size; begin
end; Attr:=Info.Attr;
If P^.Name<>Nil then
Name:=strpas(p^.name);
Time:=Sinfo.mtime;
Size:=Sinfo.Size;
end;
end;
P^.Next:=Nil;
GlobFree(P);
end; end;
end; end;
Function DoFind(Var Rslt : TSearchRec) : Longint; Function DoFind(Var Rslt : TSearchRec) : Longint;
begin begin
Result:=-1;
If Rslt.FindHandle<>0 then If Rslt.FindHandle<>0 then
While (Rslt.FindHandle<>0) and GlobToTSearchRec(Rslt) do; While (Rslt.FindHandle<>0) and not (Result=0) do
If Rslt.FindHandle=0 Then If GlobToTSearchRec(Rslt) Then Result:=0;
Result:=-1
else
Result:=0;
end; end;
@ -217,8 +220,7 @@ end;
Function FileSetAttr (Const Filename : String; Attr: longint) : Longint; Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
begin begin
//!! Still Needs doing Result:=-1;
Result:=0;
end; end;
@ -281,7 +283,10 @@ end;
{ {
$Log$ $Log$
Revision 1.10 1999-05-13 21:54:09 michael Revision 1.11 1999-05-14 22:19:34 michael
* Some more fixes.
Revision 1.10 1999/05/13 21:54:09 michael
* Fixed FileAge and corrected FileGetAttr * Fixed FileAge and corrected FileGetAttr
Revision 1.9 1999/04/08 11:31:01 peter Revision 1.9 1999/04/08 11:31:01 peter