ex19.pp 399 B

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