Please don't use the objpas unit directly in the uses clause. Please put a {$mode objfpc}…
Peter Vreman wrote 13 lines
Better yet:
FOR ALL LOW-LEVEL FILE/DISK/DATE STUFF, use the sysutils unit. It is 100% Delphi compatible, and exists on all platforms.
The reason FCL compiles on all platforms is because it uses the sysutils unit only !
In concreto:
fdOPen -> FileOpen/FileCreate
fdRead -> FileRead
fdWrite -> FileWrite
fdSeek -> FileSeek
fdTruncate -> FileTruncate
It also has many file-name handling functions:
ExtractFileName
ExtractFileExt
ExtractFilePath
ExtractFileDir
ExtractRelativePath (NOt in Delphi)
Which autmatically take care of / or \ issues and the like.
Using the sysutils unit for low-level stuff makes porting more easier.
Michael.
