sysutils.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Florian Klaempfl
  5. member of the Free Pascal development team
  6. Sysutils unit for linux
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. unit sysutils;
  14. interface
  15. {$MODE objfpc}
  16. { force ansistrings }
  17. {$H+}
  18. {$DEFINE HAS_SLEEP}
  19. {$DEFINE HAS_OSERROR}
  20. {$DEFINE HAS_OSCONFIG}
  21. {$DEFINE HASUNIX}
  22. uses
  23. Unix,errors,sysconst;
  24. { Include platform independent interface part }
  25. {$i sysutilh.inc}
  26. implementation
  27. Uses UnixUtil,Baseunix,UnixType;
  28. {$Define OS_FILEISREADONLY} // Specific implementation for Unix.
  29. { Include platform independent implementation part }
  30. {$i sysutils.inc}
  31. {****************************************************************************
  32. File Functions
  33. ****************************************************************************}
  34. Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
  35. Var LinuxFlags : longint;
  36. BEGIN
  37. LinuxFlags:=0;
  38. Case (Mode and 3) of
  39. 0 : LinuxFlags:=LinuxFlags or O_RdOnly;
  40. 1 : LinuxFlags:=LinuxFlags or O_WrOnly;
  41. 2 : LinuxFlags:=LinuxFlags or O_RdWr;
  42. end;
  43. FileOpen:=fpOpen (FileName,LinuxFlags);
  44. //!! We need to set locking based on Mode !!
  45. end;
  46. Function FileCreate (Const FileName : String) : Longint;
  47. begin
  48. FileCreate:=fpOpen(FileName,O_RdWr or O_Creat or O_Trunc);
  49. end;
  50. Function FileCreate (Const FileName : String;Mode : Longint) : Longint;
  51. Var LinuxFlags : longint;
  52. BEGIN
  53. LinuxFlags:=0;
  54. Case (Mode and 3) of
  55. 0 : LinuxFlags:=LinuxFlags or O_RdOnly;
  56. 1 : LinuxFlags:=LinuxFlags or O_WrOnly;
  57. 2 : LinuxFlags:=LinuxFlags or O_RdWr;
  58. end;
  59. FileCreate:=fpOpen(FileName,LinuxFlags or O_Creat or O_Trunc);
  60. end;
  61. Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  62. begin
  63. FileRead:=fpRead (Handle,Buffer,Count);
  64. end;
  65. Function FileWrite (Handle : Longint; const Buffer; Count : Longint) : Longint;
  66. begin
  67. FileWrite:=fpWrite (Handle,Buffer,Count);
  68. end;
  69. Function FileSeek (Handle,FOffset,Origin : Longint) : Longint;
  70. begin
  71. FileSeek:=fplSeek (Handle,FOffset,Origin);
  72. end;
  73. Function FileSeek (Handle : Longint; FOffset,Origin : Int64) : Int64;
  74. begin
  75. {$warning need to add 64bit call }
  76. FileSeek:=fplSeek (Handle,FOffset,Origin);
  77. end;
  78. Procedure FileClose (Handle : Longint);
  79. begin
  80. fpclose(Handle);
  81. end;
  82. Function FileTruncate (Handle,Size: Longint) : boolean;
  83. begin
  84. FileTruncate:=fpftruncate(Handle,Size)>=0;
  85. end;
  86. Function UnixToWinAge(UnixAge : time_t): Longint;
  87. Var
  88. Y,M,D,hh,mm,ss : word;
  89. begin
  90. EpochToLocal(UnixAge,y,m,d,hh,mm,ss);
  91. Result:=DateTimeToFileDate(EncodeDate(y,m,d)+EncodeTime(hh,mm,ss,0));
  92. end;
  93. Function FileAge (Const FileName : String): Longint;
  94. Var Info : Stat;
  95. Y,M,D,hh,mm,ss : word;
  96. begin
  97. If fpstat (FileName,Info)<0 then
  98. exit(-1)
  99. else
  100. Result:=UnixToWinAge(info.st_mtime);
  101. end;
  102. Function FileExists (Const FileName : String) : Boolean;
  103. Var Info : Stat;
  104. begin
  105. FileExists:=fpstat(filename,Info)>=0;
  106. end;
  107. Function DirectoryExists (Const Directory : String) : Boolean;
  108. Var Info : Stat;
  109. begin
  110. DirectoryExists:=(fpstat(Directory,Info)>=0) and fpS_ISDIR(Info.st_mode);
  111. end;
  112. Function LinuxToWinAttr (FN : Pchar; Const Info : Stat) : Longint;
  113. begin
  114. Result:=faArchive;
  115. If fpS_ISDIR(Info.st_mode) then
  116. Result:=Result or faDirectory;
  117. If (FN[0]='.') and (not (FN[1] in [#0,'.'])) then
  118. Result:=Result or faHidden;
  119. If (Info.st_Mode and S_IWUSR)=0 Then
  120. Result:=Result or faReadOnly;
  121. If fpS_ISSOCK(Info.st_mode) or fpS_ISBLK(Info.st_mode) or fpS_ISCHR(Info.st_mode) or fpS_ISFIFO(Info.st_mode) Then
  122. Result:=Result or faSysFile;
  123. end;
  124. {
  125. GlobToSearch takes a glob entry, stats the file.
  126. The glob entry is removed.
  127. If FileAttributes match, the entry is reused
  128. }
  129. Type
  130. TGlobSearchRec = Record
  131. Path : String;
  132. GlobHandle : PGlob;
  133. end;
  134. PGlobSearchRec = ^TGlobSearchRec;
  135. Function GlobToTSearchRec (Var Info : TSearchRec) : Boolean;
  136. Var SInfo : Stat;
  137. p : Pglob;
  138. GlobSearchRec : PGlobSearchrec;
  139. begin
  140. GlobSearchRec:=Info.FindHandle;
  141. P:=GlobSearchRec^.GlobHandle;
  142. Result:=P<>Nil;
  143. If Result then
  144. begin
  145. GlobSearchRec^.GlobHandle:=P^.Next;
  146. Result:=Fpstat(GlobSearchRec^.Path+StrPas(p^.name),SInfo)>=0;
  147. If Result then
  148. begin
  149. Info.Attr:=LinuxToWinAttr(p^.name,SInfo);
  150. Result:=(Info.ExcludeAttr and Info.Attr)=0;
  151. If Result Then
  152. With Info do
  153. begin
  154. Attr:=Info.Attr;
  155. If P^.Name<>Nil then
  156. Name:=strpas(p^.name);
  157. Time:=UnixToWinAge(Sinfo.st_mtime);
  158. Size:=Sinfo.st_Size;
  159. end;
  160. end;
  161. P^.Next:=Nil;
  162. GlobFree(P);
  163. end;
  164. end;
  165. Function DoFind(Var Rslt : TSearchRec) : Longint;
  166. Var
  167. GlobSearchRec : PGlobSearchRec;
  168. begin
  169. Result:=-1;
  170. GlobSearchRec:=Rslt.FindHandle;
  171. If (GlobSearchRec^.GlobHandle<>Nil) then
  172. While (GlobSearchRec^.GlobHandle<>Nil) and not (Result=0) do
  173. If GlobToTSearchRec(Rslt) Then Result:=0;
  174. end;
  175. Function FindFirst (Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
  176. Var
  177. GlobSearchRec : PGlobSearchRec;
  178. begin
  179. New(GlobSearchRec);
  180. GlobSearchRec^.Path:=ExpandFileName(ExtractFilePath(Path));
  181. GlobSearchRec^.GlobHandle:=Glob(Path);
  182. Rslt.ExcludeAttr:=Not Attr and (faHidden or faSysFile or faVolumeID or faDirectory); //!! Not correct !!
  183. Rslt.FindHandle:=GlobSearchRec;
  184. Result:=DoFind (Rslt);
  185. end;
  186. Function FindNext (Var Rslt : TSearchRec) : Longint;
  187. begin
  188. Result:=DoFind (Rslt);
  189. end;
  190. Procedure FindClose (Var F : TSearchrec);
  191. Var
  192. GlobSearchRec : PGlobSearchRec;
  193. begin
  194. GlobSearchRec:=F.FindHandle;
  195. GlobFree (GlobSearchRec^.GlobHandle);
  196. Dispose(GlobSearchRec);
  197. end;
  198. Function FileGetDate (Handle : Longint) : Longint;
  199. Var Info : Stat;
  200. begin
  201. If (fpFStat(Handle,Info))<0 then
  202. Result:=-1
  203. else
  204. Result:=Info.st_Mtime;
  205. end;
  206. Function FileSetDate (Handle,Age : Longint) : Longint;
  207. begin
  208. // Impossible under Linux from FileHandle !!
  209. FileSetDate:=-1;
  210. end;
  211. Function FileGetAttr (Const FileName : String) : Longint;
  212. Var Info : Stat;
  213. begin
  214. If FpStat (FileName,Info)<0 then
  215. Result:=-1
  216. Else
  217. Result:=LinuxToWinAttr(Pchar(FileName),Info);
  218. end;
  219. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  220. begin
  221. Result:=-1;
  222. end;
  223. Function DeleteFile (Const FileName : String) : Boolean;
  224. begin
  225. Result:=fpUnLink (FileName)>=0;
  226. end;
  227. Function RenameFile (Const OldName, NewName : String) : Boolean;
  228. begin
  229. RenameFile:=BaseUnix.FpRename(OldNAme,NewName)>=0;
  230. end;
  231. Function FileIsReadOnly(const FileName: String): Boolean;
  232. begin
  233. Result := fpAccess(PChar(FileName),W_OK)<>0;
  234. end;
  235. {****************************************************************************
  236. Disk Functions
  237. ****************************************************************************}
  238. {
  239. The Diskfree and Disksize functions need a file on the specified drive, since this
  240. is required for the statfs system call.
  241. These filenames are set in drivestr[0..26], and have been preset to :
  242. 0 - '.' (default drive - hence current dir is ok.)
  243. 1 - '/fd0/.' (floppy drive 1 - should be adapted to local system )
  244. 2 - '/fd1/.' (floppy drive 2 - should be adapted to local system )
  245. 3 - '/' (C: equivalent of dos is the root partition)
  246. 4..26 (can be set by you're own applications)
  247. ! Use AddDisk() to Add new drives !
  248. They both return -1 when a failure occurs.
  249. }
  250. Const
  251. FixDriveStr : array[0..3] of pchar=(
  252. '.',
  253. '/fd0/.',
  254. '/fd1/.',
  255. '/.'
  256. );
  257. var
  258. Drives : byte;
  259. DriveStr : array[4..26] of pchar;
  260. Procedure AddDisk(const path:string);
  261. begin
  262. if not (DriveStr[Drives]=nil) then
  263. FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
  264. GetMem(DriveStr[Drives],length(Path)+1);
  265. StrPCopy(DriveStr[Drives],path);
  266. inc(Drives);
  267. if Drives>26 then
  268. Drives:=4;
  269. end;
  270. Function DiskFree(Drive: Byte): int64;
  271. var
  272. fs : tstatfs;
  273. Begin
  274. if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (statfs(StrPas(fixdrivestr[drive]),fs)<>-1)) or
  275. ((not (drivestr[Drive]=nil)) and (statfs(StrPas(drivestr[drive]),fs)<>-1)) then
  276. Diskfree:=int64(fs.bavail)*int64(fs.bsize)
  277. else
  278. Diskfree:=-1;
  279. End;
  280. Function DiskSize(Drive: Byte): int64;
  281. var
  282. fs : tstatfs;
  283. Begin
  284. if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and (statfs(StrPas(fixdrivestr[drive]),fs)<>-1)) or
  285. ((not (drivestr[Drive]=nil)) and (statfs(StrPas(drivestr[drive]),fs)<>-1)) then
  286. DiskSize:=int64(fs.blocks)*int64(fs.bsize)
  287. else
  288. DiskSize:=-1;
  289. End;
  290. Function GetCurrentDir : String;
  291. begin
  292. GetDir (0,Result);
  293. end;
  294. Function SetCurrentDir (Const NewDir : String) : Boolean;
  295. begin
  296. {$I-}
  297. ChDir(NewDir);
  298. {$I+}
  299. result := (IOResult = 0);
  300. end;
  301. Function CreateDir (Const NewDir : String) : Boolean;
  302. begin
  303. {$I-}
  304. MkDir(NewDir);
  305. {$I+}
  306. result := (IOResult = 0);
  307. end;
  308. Function RemoveDir (Const Dir : String) : Boolean;
  309. begin
  310. {$I-}
  311. RmDir(Dir);
  312. {$I+}
  313. result := (IOResult = 0);
  314. end;
  315. {****************************************************************************
  316. Misc Functions
  317. ****************************************************************************}
  318. procedure Beep;
  319. begin
  320. end;
  321. {****************************************************************************
  322. Locale Functions
  323. ****************************************************************************}
  324. Procedure GetLocalTime(var SystemTime: TSystemTime);
  325. begin
  326. Unix.GetTime(SystemTime.Hour, SystemTime.Minute, SystemTime.Second);
  327. Unix.GetDate(SystemTime.Year, SystemTime.Month, SystemTime.Day);
  328. SystemTime.MilliSecond := 0;
  329. end ;
  330. Procedure InitAnsi;
  331. Var
  332. i : longint;
  333. begin
  334. { Fill table entries 0 to 127 }
  335. for i := 0 to 96 do
  336. UpperCaseTable[i] := chr(i);
  337. for i := 97 to 122 do
  338. UpperCaseTable[i] := chr(i - 32);
  339. for i := 123 to 191 do
  340. UpperCaseTable[i] := chr(i);
  341. Move (CPISO88591UCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  342. for i := 0 to 64 do
  343. LowerCaseTable[i] := chr(i);
  344. for i := 65 to 90 do
  345. LowerCaseTable[i] := chr(i + 32);
  346. for i := 91 to 191 do
  347. LowerCaseTable[i] := chr(i);
  348. Move (CPISO88591LCT,LowerCaseTable[192],SizeOf(CPISO88591UCT));
  349. end;
  350. Procedure InitInternational;
  351. begin
  352. InitAnsi;
  353. end;
  354. function SysErrorMessage(ErrorCode: Integer): String;
  355. begin
  356. Result:=StrError(ErrorCode);
  357. end;
  358. {****************************************************************************
  359. OS utility functions
  360. ****************************************************************************}
  361. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  362. begin
  363. Result:=StrPas(BaseUnix.FPGetenv(PChar(EnvVar)));
  364. end;
  365. {$define FPC_USE_FPEXEC} // leave the old code under IFDEF for a while.
  366. function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString):integer;
  367. var
  368. pid : longint;
  369. err : longint;
  370. e : EOSError;
  371. CommandLine: AnsiString;
  372. cmdline2 : ppchar;
  373. Begin
  374. { always surround the name of the application by quotes
  375. so that long filenames will always be accepted. But don't
  376. do it if there are already double quotes!
  377. }
  378. {$ifdef FPC_USE_FPEXEC} // Only place we still parse
  379. cmdline2:=nil;
  380. if Comline<>'' Then
  381. begin
  382. CommandLine:=ComLine;
  383. cmdline2:=StringtoPPChar(CommandLine,1);
  384. cmdline2^:=pchar(Path);
  385. end
  386. else
  387. begin
  388. getmem(cmdline2,2*sizeof(pchar));
  389. cmdline2^:=pchar(Path);
  390. cmdline2[1]:=nil;
  391. end;
  392. {$else}
  393. if Pos ('"', Path) = 0 then
  394. CommandLine := '"' + Path + '"'
  395. else
  396. CommandLine := Path;
  397. if ComLine <> '' then
  398. CommandLine := Commandline + ' ' + ComLine;
  399. {$endif}
  400. pid:=fpFork;
  401. if pid=0 then
  402. begin
  403. {The child does the actual exec, and then exits}
  404. {$ifdef FPC_USE_FPEXEC}
  405. fpexecv(pchar(Path),Cmdline2);
  406. {$else}
  407. Execl(CommandLine);
  408. {$endif}
  409. { If the execve fails, we return an exitvalue of 127, to let it be known}
  410. fpExit(127);
  411. end
  412. else
  413. if pid=-1 then {Fork failed}
  414. begin
  415. e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,-1]);
  416. e.ErrorCode:=-1;
  417. raise e;
  418. end;
  419. { We're in the parent, let's wait. }
  420. result:=WaitProcess(pid); // WaitPid and result-convert
  421. if (result>=0) and (result<>127) then
  422. result:=0
  423. else
  424. begin
  425. e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,result]);
  426. e.ErrorCode:=result;
  427. raise e;
  428. end;
  429. End;
  430. function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array Of AnsiString):integer;
  431. var
  432. pid : longint;
  433. err : longint;
  434. e : EOSError;
  435. Begin
  436. { always surround the name of the application by quotes
  437. so that long filenames will always be accepted. But don't
  438. do it if there are already double quotes!
  439. }
  440. pid:=fpFork;
  441. if pid=0 then
  442. begin
  443. {The child does the actual exec, and then exits}
  444. fpexecl(Path,Comline);
  445. { If the execve fails, we return an exitvalue of 127, to let it be known}
  446. fpExit(127);
  447. end
  448. else
  449. if pid=-1 then {Fork failed}
  450. begin
  451. e:=EOSError.CreateFmt(SExecuteProcessFailed,[Path,-1]);
  452. e.ErrorCode:=-1;
  453. raise e;
  454. end;
  455. { We're in the parent, let's wait. }
  456. result:=WaitProcess(pid); // WaitPid and result-convert
  457. if (result>=0) and (result<>127) then
  458. result:=0
  459. else
  460. begin
  461. e:=EOSError.CreateFmt(SExecuteProcessFailed,[Path,result]);
  462. e.ErrorCode:=result;
  463. raise e;
  464. end;
  465. End;
  466. procedure Sleep(milliseconds: Cardinal);
  467. Var
  468. fd : Integer;
  469. fds : TfdSet;
  470. timeout : TimeVal;
  471. begin
  472. fd:=FileOpen('/dev/null',fmOpenRead);
  473. If Not(Fd<0) then
  474. begin
  475. fpfd_zero(fds);
  476. fpfd_set(0,fds);
  477. timeout.tv_sec:=Milliseconds div 1000;
  478. timeout.tv_usec:=(Milliseconds mod 1000) * 1000;
  479. fpSelect(1,Nil,Nil,@fds,@timeout);
  480. end;
  481. end;
  482. Function GetLastOSError : Integer;
  483. begin
  484. Result:=fpgetErrNo;
  485. end;
  486. { ---------------------------------------------------------------------
  487. Application config files
  488. ---------------------------------------------------------------------}
  489. Function GetHomeDir : String;
  490. begin
  491. Result:=GetEnvironmentVariable('HOME');
  492. If (Result<>'') then
  493. Result:=IncludeTrailingPathDelimiter(Result);
  494. end;
  495. Function GetAppConfigDir(Global : Boolean) : String;
  496. begin
  497. If Global then
  498. Result:=SysConfigDir
  499. else
  500. Result:=GetHomeDir+ApplicationName;
  501. end;
  502. Function GetAppConfigFile(Global : Boolean; SubDir : Boolean) : String;
  503. begin
  504. if Global then
  505. begin
  506. Result:=IncludeTrailingPathDelimiter(SysConfigDir);
  507. if SubDir then
  508. Result:=IncludeTrailingPathDelimiter(Result+ApplicationName);
  509. Result:=Result+ApplicationName+ConfigExtension;
  510. end
  511. else
  512. begin
  513. if SubDir then
  514. begin
  515. Result:=IncludeTrailingPathDelimiter(GetAppConfigDir(False));
  516. Result:=Result+ApplicationName+ConfigExtension;
  517. end
  518. else
  519. begin
  520. Result:=GetHomeDir;
  521. Result:=Result+'.'+ApplicationName;
  522. end;
  523. end;
  524. end;
  525. {****************************************************************************
  526. Initialization code
  527. ****************************************************************************}
  528. Initialization
  529. InitExceptions; { Initialize exceptions. OS independent }
  530. InitInternational; { Initialize internationalization settings }
  531. SysConfigDir:='/etc'; { Initialize system config dir }
  532. Finalization
  533. DoneExceptions;
  534. end.
  535. {
  536. $Log$
  537. Revision 1.44 2004-08-05 07:32:51 michael
  538. Added getappconfig calls
  539. Revision 1.43 2004/07/03 21:50:31 daniel
  540. * Modified bootstrap code so separate prt0.as/prt0_10.as files are no
  541. longer necessary
  542. Revision 1.42 2004/06/15 07:36:03 michael
  543. + Fixed Globtosearchrec to use unixtowinage
  544. Revision 1.41 2004/05/22 14:25:03 michael
  545. + Fixed FindFirst/FindNext so it treats the attributes correctly
  546. Revision 1.40 2004/04/28 20:48:20 peter
  547. * ordinal-pointer conversions fixed
  548. Revision 1.39 2004/04/26 14:50:19 peter
  549. * FileIsReadOnly fixed
  550. Revision 1.38 2004/04/20 18:24:32 marco
  551. * small fix for NIL arg ptr in first executeprocess
  552. Revision 1.37 2004/03/04 22:15:16 marco
  553. * UnixType changes. Please report problems to me.
  554. Revision 1.36 2004/02/13 10:50:23 marco
  555. * Hopefully last large changes to fpexec and friends.
  556. - naming conventions changes from Michael.
  557. - shell functions get alternative under ifdef.
  558. - arraystring function moves to unixutil
  559. - unixutil now regards quotes in stringtoppchar.
  560. - sysutils/unix get executeprocess(ansi,array of ansi), and
  561. both executeprocess functions are fixed
  562. - Sysutils/win32 get executeprocess(ansi,array of ansi)
  563. Revision 1.35 2004/02/12 15:31:06 marco
  564. * First version of fpexec change. Still under ifdef or silently overloaded
  565. Revision 1.34 2004/02/09 17:11:17 marco
  566. * fixed for 1.0 errno->fpgeterrno
  567. Revision 1.33 2004/02/08 14:50:51 michael
  568. + Added fileIsReadOnly
  569. Revision 1.32 2004/02/08 11:01:17 michael
  570. + Implemented getlastoserror
  571. Revision 1.31 2004/01/20 23:13:53 hajny
  572. * ExecuteProcess fixes, ProcessID and ThreadID added
  573. Revision 1.30 2004/01/10 17:34:36 michael
  574. + Implemented sleep() on Unix.
  575. Revision 1.29 2004/01/05 22:42:35 florian
  576. * compilation error fixed
  577. Revision 1.28 2004/01/05 22:37:15 florian
  578. * changed sysutils.exec to ExecuteProcess
  579. Revision 1.27 2004/01/03 09:09:11 marco
  580. * Unix exec(ansistring)
  581. Revision 1.26 2003/11/26 20:35:14 michael
  582. + Some fixes to have everything compile again
  583. Revision 1.25 2003/11/17 10:05:51 marco
  584. * threads for FreeBSD. Not working tho
  585. Revision 1.24 2003/10/25 23:43:59 hajny
  586. * THandle in sysutils common using System.THandle
  587. Revision 1.23 2003/10/07 08:28:49 marco
  588. * fix from Vincent to casetables
  589. Revision 1.22 2003/09/27 12:51:33 peter
  590. * fpISxxx macros renamed to C compliant fpS_ISxxx
  591. Revision 1.21 2003/09/17 19:07:44 marco
  592. * more fixes for Unix<->unixutil
  593. Revision 1.20 2003/09/17 12:41:31 marco
  594. * Uses more baseunix, less unix now
  595. Revision 1.19 2003/09/14 20:15:01 marco
  596. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  597. Revision 1.18 2003/04/01 15:57:41 peter
  598. * made THandle platform dependent and unique type
  599. Revision 1.17 2003/03/30 10:38:00 armin
  600. * corrected typo in DirectoryExists
  601. Revision 1.16 2003/03/29 18:21:42 hajny
  602. * DirectoryExists declaration changed to that one from fixes branch
  603. Revision 1.15 2003/03/28 19:06:59 peter
  604. * directoryexists added
  605. Revision 1.14 2003/01/03 20:41:04 peter
  606. * FileCreate(string,mode) overload added
  607. Revision 1.13 2002/09/07 16:01:28 peter
  608. * old logs removed and tabs fixed
  609. Revision 1.12 2002/01/25 16:23:03 peter
  610. * merged filesearch() fix
  611. }