ex19.pp 393 B

12345678910111213141516171819
  1. Program Example19;
  2. { Program to demonstrate the fdOpen, fdwrite and fdCLose functions. }
  3. Uses BaseUnix;
  4. Const Line : String[80] = 'This is easy writing !';
  5. Var FD : Cint;
  6. begin
  7. FD:=fpOpen ('Test.dat',O_WrOnly or O_Creat);
  8. if FD>0 then
  9. begin
  10. if length(Line)<>fpwrite (FD,Line[1],Length(Line)) then
  11. Writeln ('Error when writing to file !');
  12. fpClose(FD);
  13. end;
  14. end.