Browse Source

* Revert 6964

git-svn-id: trunk@7000 -
daniel 18 years ago
parent
commit
5acd85f447
2 changed files with 21 additions and 21 deletions
  1. 11 11
      rtl/unix/dos.pp
  2. 10 10
      rtl/unix/sysutils.pp

+ 11 - 11
rtl/unix/dos.pp

@@ -559,27 +559,27 @@ begin
   FindGetFileInfo:=false;
   if not fpstat(s,st)>=0 then
    exit;
-  info.FSize:=st.size;
-  info.FMTime:=st.mtime;
-  if (st.mode and STAT_IFMT)=STAT_IFDIR then
+  info.FSize:=st.st_Size;
+  info.FMTime:=st.st_mtime;
+  if (st.st_mode and STAT_IFMT)=STAT_IFDIR then
    info.fmode:=$10
   else
    info.fmode:=$0;
-  if (st.mode and STAT_IWUSR)=0 then
+  if (st.st_mode and STAT_IWUSR)=0 then
    info.fmode:=info.fmode or 1;
   if s[f.NamePos+1]='.' then
    info.fmode:=info.fmode or $2;
 
-  if Info.FMode and Not(f.searchattr)=0 Then
-   begin
+  If ((Info.FMode and Not(f.searchattr))=0) Then
+   Begin
      f.Name:=Copy(s,f.NamePos+1,255);
      f.Attr:=Info.FMode;
-     f.Mode:=word(st.mode);
      f.Size:=Info.FSize;
+     f.mode:=st.st_mode;
      UnixDateToDT(Info.FMTime, DT);
      PackTime(DT,f.Time);
      FindGetFileInfo:=true;
-   end;
+   End;
 end;
 
 
@@ -757,7 +757,7 @@ Function FSearch(path : pathstr;dirlist : string) : pathstr;
 Var
   info : BaseUnix.stat;
 Begin
-  if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) and (not fpS_ISDIR(Info.mode)) then
+  if (length(Path)>0) and (path[1]='/') and (fpStat(path,info)>=0) and (not fpS_ISDIR(Info.st_Mode)) then
     FSearch:=path
   else
     FSearch:=Unix.FSearch(path,dirlist);
@@ -776,7 +776,7 @@ Begin
      exit;
    end
   else
-   LinAttr:=Info.mode;
+   LinAttr:=Info.st_Mode;
   if fpS_ISDIR(LinAttr) then
    Attr:=$10
   else
@@ -800,7 +800,7 @@ Begin
      exit
    end
   else
-   UnixDateToDT(Info.mTime,DT);
+   UnixDateToDT(Info.st_mTime,DT);
   PackTime(DT,Time);
 End;
 

+ 10 - 10
rtl/unix/sysutils.pp

@@ -267,7 +267,7 @@ begin
   If  fpstat (FileName,Info)<0 then
     exit(-1)
   else
-    Result:=UnixToWinAge(info.mtime);
+    Result:=UnixToWinAge(info.st_mtime);
 end;
 
 
@@ -285,7 +285,7 @@ Function DirectoryExists (Const Directory : String) : Boolean;
 Var Info : Stat;
 
 begin
-  DirectoryExists:=(fpstat(Directory,Info)>=0) and fpS_ISDIR(Info.mode);
+  DirectoryExists:=(fpstat(Directory,Info)>=0) and fpS_ISDIR(Info.st_mode);
 end;
 
 
@@ -293,15 +293,15 @@ Function LinuxToWinAttr (FN : Pchar; Const Info : Stat) : Longint;
 
 begin
   Result:=faArchive;
-  If fpS_ISDIR(Info.mode) then
+  If fpS_ISDIR(Info.st_mode) then
     Result:=Result or faDirectory;
   If (FN[0]='.') and (not (FN[1] in [#0,'.']))  then
     Result:=Result or faHidden;
-  If (Info.Mode and S_IWUSR)=0 Then
+  If (Info.st_Mode and S_IWUSR)=0 Then
      Result:=Result or faReadOnly;
-  If fpS_ISSOCK(Info.mode) or fpS_ISBLK(Info.mode) or fpS_ISCHR(Info.mode) or fpS_ISFIFO(Info.mode) Then
+  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
      Result:=Result or faSysFile;
-  If fpS_ISLNK(Info.mode) Then
+  If fpS_ISLNK(Info.st_mode) Then
     Result:=Result or faSymLink;
 end;
 
@@ -430,9 +430,9 @@ begin
    Begin
      f.Name:=ExtractFileName(s);
      f.Attr:=WinAttr;
-     f.Size:=st.Size;
-     f.Mode:=st.mode;
-     f.Time:=UnixToWinAge(st.mtime);
+     f.Size:=st.st_Size;
+     f.Mode:=st.st_mode;
+     f.Time:=UnixToWinAge(st.st_mtime);
      result:=true;
    End;
 end;
@@ -537,7 +537,7 @@ begin
   If (fpFStat(Handle,Info))<0 then
     Result:=-1
   else
-    Result:=Info.Mtime;
+    Result:=Info.st_Mtime;
 end;