Function fdOpen (pathname:string;flags:longint[; Mode: longint]) : longint;
fdOpen opens a file in pathname with flags flags a ORed combination of Open_Accmode, Open_RdOnly, Open_WrOnly, Open_RdWr, Open_Creat, Open_Excl, Open_NoCtty, Open_Trunc, Open_Append, Open_NonBlock, Open_NDelay, Open_Sync
The optional mode argument specifies the permissions to set when opening the file. This is modified by the umask setting. The real permissions are Mode and not umask.
The return value of the function is the filedescriptor, or a negative value if there was an error.
Errors are returned in LinuxError
fdClose, fdRead, fdWrite,fdTruncate
Program Example19; { Program to demonstrate the fdOpen, fdwrite and fdCLose functions. } Uses linux; Const Line : String[80] = 'This is easy writing !'; Var FD : Longint; begin FD:=fdOpen ('Test.dat',Open_WrOnly or Open_Creat); if FD>0 then begin if length(Line)<>fdwrite (FD,Line[1],Length(Line)) then Writeln ('Error when writing to file !'); fdClose(FD); end; end.