From fe840931adeb1a1bd9f058110d4cf2e2bc87ecfb Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 17 Jul 2004 22:22:40 +0000 Subject: [PATCH] * 1.9.x updates --- docs/linuxex/ex19.pp | 10 +++++----- docs/linuxex/ex20.pp | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/linuxex/ex19.pp b/docs/linuxex/ex19.pp index db55a1c868..4694aa29d2 100644 --- a/docs/linuxex/ex19.pp +++ b/docs/linuxex/ex19.pp @@ -2,18 +2,18 @@ Program Example19; { Program to demonstrate the fdOpen, fdwrite and fdCLose functions. } -Uses linux; +Uses BaseUnix; Const Line : String[80] = 'This is easy writing !'; -Var FD : Longint; +Var FD : Cint; begin - FD:=fdOpen ('Test.dat',Open_WrOnly or Open_Creat); + FD:=fpOpen ('Test.dat',O_WrOnly or O_Creat); if FD>0 then begin - if length(Line)<>fdwrite (FD,Line[1],Length(Line)) then + if length(Line)<>fpwrite (FD,Line[1],Length(Line)) then Writeln ('Error when writing to file !'); - fdClose(FD); + fpClose(FD); end; end. diff --git a/docs/linuxex/ex20.pp b/docs/linuxex/ex20.pp index c64db7861e..dd77058e52 100644 --- a/docs/linuxex/ex20.pp +++ b/docs/linuxex/ex20.pp @@ -2,44 +2,44 @@ Program Example20; { Program to demonstrate the fdRead and fdTruncate functions. } -Uses linux; +Uses BaseUnix; -Const Data : string[10] = '12345687890'; +Const Data : string[10] = '1234567890'; -Var FD : Longint; +Var FD : cint; l : longint; begin - FD:=fdOpen('test.dat',open_wronly or open_creat,octal(666)); + FD:=fpOpen('test.dat',o_wronly or o_creat,&666); if fd>0 then begin { Fill file with data } for l:=1 to 10 do - if fdWrite (FD,Data[1],10)<>10 then + if fpWrite (FD,Data[1],10)<>10 then begin writeln ('Error when writing !'); halt(1); end; - fdClose(FD); - FD:=fdOpen('test.dat',open_rdonly); + fpClose(FD); + FD:=fpOpen('test.dat',o_rdonly); { Read data again } If FD>0 then begin For l:=1 to 5 do - if fdRead (FD,Data[1],10)<>10 then + if fpRead (FD,Data[1],10)<>10 then begin Writeln ('Error when Reading !'); Halt(2); end; - fdCLose(FD); + fpClose(FD); { Truncating file at 60 bytes } { For truncating, file must be open or write } - FD:=fdOpen('test.dat',open_wronly,octal(666)); + FD:=fpOpen('test.dat',o_wronly,&666); if FD>0 then begin - if not fdTruncate(FD,60) then + if fpfTruncate(FD,60)<>0 then Writeln('Error when truncating !'); - fdClose (FD); + fpClose (FD); end; end; end;