Browse Source

* 1.9.x updates

marco 21 years ago
parent
commit
42e0038611
5 changed files with 29 additions and 28 deletions
  1. 6 5
      docs/linuxex/ex24.pp
  2. 2 2
      docs/linuxex/ex25.pp
  3. 2 2
      docs/linuxex/ex26.pp
  4. 3 3
      docs/linuxex/ex27.pp
  5. 16 16
      docs/linuxex/ex28.pp

+ 6 - 5
docs/linuxex/ex24.pp

@@ -2,9 +2,10 @@ Program Example24;
 
 { Program to demonstrate the Chown function. }
 
-Uses linux;
+Uses BaseUnix;
 
-Var UID,GID : Longint;
+Var UID : TUid;
+    GID : TGid;
     F : Text;
     
 begin
@@ -18,11 +19,11 @@ begin
   Writeln (f,'UID : ',UID);
   Writeln (f,'GID : ',GID);
   Close (F);
-  if not Chown ('test.txt',UID,GID) then
-    if LinuxError=Sys_EPERM then
+  if fpChown ('test.txt',UID,GID)<>0 then
+    if fpgeterrno=ESysEPERM then
       Writeln ('You are not root !')
     else
-      Writeln ('Chmod failed with exit code : ',LinuxError)
+      Writeln ('Chmod failed with exit code : ',fpgeterrno)
   else
     Writeln ('Changed owner successfully !');
 end.

+ 2 - 2
docs/linuxex/ex25.pp

@@ -2,7 +2,7 @@ Program Example25;
 
 { Program to demonstrate the UTime function. }
 
-Uses linux;
+Uses BaseUnix,Unix,UnixUtil;
 
 Var utim : utimbuf;
     year,month,day,hour,minute,second : Word;
@@ -13,7 +13,7 @@ begin
   GetDate (year,month,day);  
   utim.actime:=LocalToEpoch(year,month,day,hour,minute,second);
   utim.modtime:=utim.actime;
-  if not Utime('ex25.pp',utim) then
+  if Fputime('ex25.pp',@utim)<>0 then
     writeln ('Call to UTime failed !')
   else
     begin

+ 2 - 2
docs/linuxex/ex26.pp

@@ -2,10 +2,10 @@ Program Example26;
 
 { Program to demonstrate the Access function. }
 
-Uses linux;
+Uses BaseUnix;
 
 begin
-  if Access ('/etc/passwd',W_OK) then
+  if fpAccess ('/etc/passwd',W_OK)=0 then
     begin
     Writeln ('Better check your system.');
     Writeln ('I can write to the /etc/passwd file !');

+ 3 - 3
docs/linuxex/ex27.pp

@@ -2,9 +2,9 @@ Program Example27;
 
 { Program to demonstrate the Umask function. }
 
-Uses linux;
+Uses BaseUnix;
 
 begin
-  Writeln ('Old Umask was : ',Umask(Octal(111)));
-  WRiteln ('New Umask is  : ',Octal(111));
+  Writeln ('Old Umask was : ',fpUmask(&111));
+  WRiteln ('New Umask is  : ',&111);
 end.

+ 16 - 16
docs/linuxex/ex28.pp

@@ -2,7 +2,7 @@ program example28;
 
 { Program to demonstrate the FStat function. }
 
-uses linux;
+uses BaseUnix;
     
 var f : text;    
     i : byte;
@@ -15,25 +15,25 @@ begin
   for i:=1 to 10 do writeln (f,'Testline # ',i);
   close (f);
   { Do the call on made file. }
-  if not fstat ('test.fil',info) then 
+  if fpstat ('test.fil',info)<>0 then 
      begin
-     writeln('Fstat failed. Errno : ',linuxerror);
-     halt (1);
+       writeln('Fstat failed. Errno : ',fpgeterrno);
+       halt (1);
      end;
   writeln;
   writeln ('Result of fstat on file ''test.fil''.');
-  writeln ('Inode   : ',info.ino);
-  writeln ('Mode    : ',info.mode);
-  writeln ('nlink   : ',info.nlink);
-  writeln ('uid     : ',info.uid);
-  writeln ('gid     : ',info.gid);
-  writeln ('rdev    : ',info.rdev);
-  writeln ('Size    : ',info.size);
-  writeln ('Blksize : ',info.blksze);
-  writeln ('Blocks  : ',info.blocks);
-  writeln ('atime   : ',info.atime);
-  writeln ('mtime   : ',info.mtime);
-  writeln ('ctime   : ',info.ctime);
+  writeln ('Inode   : ',info.st_ino);
+  writeln ('Mode    : ',info.st_mode);
+  writeln ('nlink   : ',info.st_nlink);
+  writeln ('uid     : ',info.st_uid);
+  writeln ('gid     : ',info.st_gid);
+  writeln ('rdev    : ',info.st_rdev);
+  writeln ('Size    : ',info.st_size);
+  writeln ('Blksize : ',info.st_blksize);
+  writeln ('Blocks  : ',info.st_blocks);
+  writeln ('atime   : ',info.st_atime);
+  writeln ('mtime   : ',info.st_mtime);
+  writeln ('ctime   : ',info.st_ctime);
   { Remove file }  
   erase (f);    
 end.