mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 07:30:11 +02:00
* Switch to classic field names to prevent further messing with compatibility.
git-svn-id: trunk@6964 -
This commit is contained in:
parent
d030103742
commit
8127fb7a05
@ -31,7 +31,8 @@ Type
|
|||||||
DirPtr : Pointer; {directory pointer for reading directory}
|
DirPtr : Pointer; {directory pointer for reading directory}
|
||||||
SearchType : Byte; {0=normal, 1=open will close, 2=only 1 file}
|
SearchType : Byte; {0=normal, 1=open will close, 2=only 1 file}
|
||||||
SearchAttr : Byte; {attribute we are searching for}
|
SearchAttr : Byte; {attribute we are searching for}
|
||||||
Fill : Array[1..03] of Byte; {future use}
|
Mode : Word;
|
||||||
|
Fill : Array[1..1] of Byte; {future use}
|
||||||
{End of fill}
|
{End of fill}
|
||||||
Attr : Byte; {attribute of found file}
|
Attr : Byte; {attribute of found file}
|
||||||
Time : LongInt; {last modify date of found file}
|
Time : LongInt; {last modify date of found file}
|
||||||
@ -558,26 +559,27 @@ begin
|
|||||||
FindGetFileInfo:=false;
|
FindGetFileInfo:=false;
|
||||||
if not fpstat(s,st)>=0 then
|
if not fpstat(s,st)>=0 then
|
||||||
exit;
|
exit;
|
||||||
info.FSize:=st.st_Size;
|
info.FSize:=st.size;
|
||||||
info.FMTime:=st.st_mtime;
|
info.FMTime:=st.mtime;
|
||||||
if (st.st_mode and STAT_IFMT)=STAT_IFDIR then
|
if (st.mode and STAT_IFMT)=STAT_IFDIR then
|
||||||
info.fmode:=$10
|
info.fmode:=$10
|
||||||
else
|
else
|
||||||
info.fmode:=$0;
|
info.fmode:=$0;
|
||||||
if (st.st_mode and STAT_IWUSR)=0 then
|
if (st.mode and STAT_IWUSR)=0 then
|
||||||
info.fmode:=info.fmode or 1;
|
info.fmode:=info.fmode or 1;
|
||||||
if s[f.NamePos+1]='.' then
|
if s[f.NamePos+1]='.' then
|
||||||
info.fmode:=info.fmode or $2;
|
info.fmode:=info.fmode or $2;
|
||||||
|
|
||||||
If ((Info.FMode and Not(f.searchattr))=0) Then
|
if Info.FMode and Not(f.searchattr)=0 Then
|
||||||
Begin
|
begin
|
||||||
f.Name:=Copy(s,f.NamePos+1,255);
|
f.Name:=Copy(s,f.NamePos+1,255);
|
||||||
f.Attr:=Info.FMode;
|
f.Attr:=Info.FMode;
|
||||||
|
f.Mode:=word(st.mode);
|
||||||
f.Size:=Info.FSize;
|
f.Size:=Info.FSize;
|
||||||
UnixDateToDT(Info.FMTime, DT);
|
UnixDateToDT(Info.FMTime, DT);
|
||||||
PackTime(DT,f.Time);
|
PackTime(DT,f.Time);
|
||||||
FindGetFileInfo:=true;
|
FindGetFileInfo:=true;
|
||||||
End;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -755,7 +757,7 @@ Function FSearch(path : pathstr;dirlist : string) : pathstr;
|
|||||||
Var
|
Var
|
||||||
info : BaseUnix.stat;
|
info : BaseUnix.stat;
|
||||||
Begin
|
Begin
|
||||||
if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) and (not fpS_ISDIR(Info.st_Mode)) then
|
if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) and (not fpS_ISDIR(Info.mode)) then
|
||||||
FSearch:=path
|
FSearch:=path
|
||||||
else
|
else
|
||||||
FSearch:=Unix.FSearch(path,dirlist);
|
FSearch:=Unix.FSearch(path,dirlist);
|
||||||
@ -774,7 +776,7 @@ Begin
|
|||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
LinAttr:=Info.st_Mode;
|
LinAttr:=Info.mode;
|
||||||
if fpS_ISDIR(LinAttr) then
|
if fpS_ISDIR(LinAttr) then
|
||||||
Attr:=$10
|
Attr:=$10
|
||||||
else
|
else
|
||||||
@ -798,7 +800,7 @@ Begin
|
|||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
UnixDateToDT(Info.st_mTime,DT);
|
UnixDateToDT(Info.mTime,DT);
|
||||||
PackTime(DT,Time);
|
PackTime(DT,Time);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ begin
|
|||||||
If fpstat (FileName,Info)<0 then
|
If fpstat (FileName,Info)<0 then
|
||||||
exit(-1)
|
exit(-1)
|
||||||
else
|
else
|
||||||
Result:=UnixToWinAge(info.st_mtime);
|
Result:=UnixToWinAge(info.mtime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ Function DirectoryExists (Const Directory : String) : Boolean;
|
|||||||
Var Info : Stat;
|
Var Info : Stat;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
DirectoryExists:=(fpstat(Directory,Info)>=0) and fpS_ISDIR(Info.st_mode);
|
DirectoryExists:=(fpstat(Directory,Info)>=0) and fpS_ISDIR(Info.mode);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -293,15 +293,15 @@ Function LinuxToWinAttr (FN : Pchar; Const Info : Stat) : Longint;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
Result:=faArchive;
|
Result:=faArchive;
|
||||||
If fpS_ISDIR(Info.st_mode) then
|
If fpS_ISDIR(Info.mode) then
|
||||||
Result:=Result or faDirectory;
|
Result:=Result or faDirectory;
|
||||||
If (FN[0]='.') and (not (FN[1] in [#0,'.'])) then
|
If (FN[0]='.') and (not (FN[1] in [#0,'.'])) then
|
||||||
Result:=Result or faHidden;
|
Result:=Result or faHidden;
|
||||||
If (Info.st_Mode and S_IWUSR)=0 Then
|
If (Info.Mode and S_IWUSR)=0 Then
|
||||||
Result:=Result or faReadOnly;
|
Result:=Result or faReadOnly;
|
||||||
If fpS_ISSOCK(Info.st_mode) or fpS_ISBLK(Info.st_mode) or fpS_ISCHR(Info.st_mode) or fpS_ISFIFO(Info.st_mode) Then
|
If fpS_ISSOCK(Info.mode) or fpS_ISBLK(Info.mode) or fpS_ISCHR(Info.mode) or fpS_ISFIFO(Info.mode) Then
|
||||||
Result:=Result or faSysFile;
|
Result:=Result or faSysFile;
|
||||||
If fpS_ISLNK(Info.st_mode) Then
|
If fpS_ISLNK(Info.mode) Then
|
||||||
Result:=Result or faSymLink;
|
Result:=Result or faSymLink;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -430,9 +430,9 @@ begin
|
|||||||
Begin
|
Begin
|
||||||
f.Name:=ExtractFileName(s);
|
f.Name:=ExtractFileName(s);
|
||||||
f.Attr:=WinAttr;
|
f.Attr:=WinAttr;
|
||||||
f.Size:=st.st_Size;
|
f.Size:=st.Size;
|
||||||
f.Mode:=st.st_mode;
|
f.Mode:=st.mode;
|
||||||
f.Time:=UnixToWinAge(st.st_mtime);
|
f.Time:=UnixToWinAge(st.mtime);
|
||||||
result:=true;
|
result:=true;
|
||||||
End;
|
End;
|
||||||
end;
|
end;
|
||||||
@ -537,7 +537,7 @@ begin
|
|||||||
If (fpFStat(Handle,Info))<0 then
|
If (fpFStat(Handle,Info))<0 then
|
||||||
Result:=-1
|
Result:=-1
|
||||||
else
|
else
|
||||||
Result:=Info.st_Mtime;
|
Result:=Info.Mtime;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user