sysutils.pp 20 KB

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