dos.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. {****************************************************************************
  2. $Id$
  3. Free Pascal Runtime-Library
  4. DOS unit for OS/2
  5. Copyright (c) 1997,1999-2000 by Daniel Mantione,
  6. member of the Free Pascal development team
  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 dos;
  14. {$ASMMODE ATT}
  15. {***************************************************************************}
  16. interface
  17. {***************************************************************************}
  18. {$PACKRECORDS 1}
  19. uses Strings, DosCalls;
  20. const {Bit masks for CPU flags.}
  21. fcarry = $0001;
  22. fparity = $0004;
  23. fauxiliary = $0010;
  24. fzero = $0040;
  25. fsign = $0080;
  26. foverflow = $0800;
  27. {Bit masks for file attributes.}
  28. readonly = $01;
  29. hidden = $02;
  30. sysfile = $04;
  31. volumeid = $08;
  32. directory = $10;
  33. archive = $20;
  34. anyfile = $3F;
  35. fmclosed = $D7B0;
  36. fminput = $D7B1;
  37. fmoutput = $D7B2;
  38. fminout = $D7B3;
  39. type {Some string types:}
  40. comstr=string; {Filenames can be long in OS/2.}
  41. pathstr=string; {String for pathnames.}
  42. dirstr=string; {String for a directory}
  43. namestr=string; {String for a filename.}
  44. extstr=string[40]; {String for an extension. Can be 253
  45. characters long, in theory, but let's
  46. say fourty will be enough.}
  47. {Search record which is used by findfirst and findnext:}
  48. searchrec=record
  49. case boolean of
  50. false: (handle:longint; {Used in os_OS2 mode}
  51. FStat:PFileFindBuf3;
  52. fill2:array[1..21-SizeOf(longint)-SizeOf(pointer)] of byte;
  53. attr2:byte;
  54. time2:longint;
  55. size2:longint;
  56. name2:string); {Filenames can be long in OS/2!}
  57. true: (fill:array[1..21] of byte;
  58. attr:byte;
  59. time:longint;
  60. size:longint;
  61. name:string); {Filenames can be long in OS/2!}
  62. end;
  63. {$i filerec.inc}
  64. {$i textrec.inc}
  65. {Data structure for the registers needed by msdos and intr:}
  66. registers=packed record
  67. case i:integer of
  68. 0:(ax,f1,bx,f2,cx,f3,dx,f4,bp,f5,si,f51,di,f6,ds,f7,es,
  69. f8,flags,fs,gs:word);
  70. 1:(al,ah,f9,f10,bl,bh,f11,f12,cl,ch,f13,f14,dl,dh:byte);
  71. 2:(eax,ebx,ecx,edx,ebp,esi,edi:longint);
  72. end;
  73. {Record for date and time:}
  74. datetime=record
  75. year,month,day,hour,min,sec:word;
  76. end;
  77. {Flags for the exec procedure:
  78. Starting the program:
  79. efwait: Wait until program terminates.
  80. efno_wait: Don't wait until the program terminates. Does not work
  81. in dos, as DOS cannot multitask.
  82. efoverlay: Terminate this program, then execute the requested
  83. program. WARNING: Exit-procedures are not called!
  84. efdebug: Debug program. Details are unknown.
  85. efsession: Do not execute as child of this program. Use a seperate
  86. session instead.
  87. efdetach: Detached. Function unknown. Info wanted!
  88. efpm: Run as presentation manager program.
  89. Not found info about execwinflags
  90. Determining the window state of the program:
  91. efdefault: Run the pm program in it's default situation.
  92. efminimize: Run the pm program minimized.
  93. efmaximize: Run the pm program maximized.
  94. effullscreen: Run the non-pm program fullscreen.
  95. efwindowed: Run the non-pm program in a window.
  96. }
  97. type execrunflags=(efwait,efno_wait,efoverlay,efdebug,efsession,
  98. efdetach,efpm);
  99. execwinflags=(efdefault,efminimize,efmaximize,effullscreen,
  100. efwindowed);
  101. const
  102. (* For compatibility with VP/2, used for runflags in Exec procedure. *)
  103. ExecFlags: cardinal = ord (efwait);
  104. var doserror:integer;
  105. dosexitcode:word;
  106. procedure getdate(var year,month,day,dayofweek:word);
  107. procedure gettime(var hour,minute,second,sec100:word);
  108. function dosversion:word;
  109. procedure setdate(year,month,day:word);
  110. procedure settime(hour,minute,second,sec100:word);
  111. procedure getcbreak(var breakvalue:boolean);
  112. procedure setcbreak(breakvalue:boolean);
  113. procedure getverify(var verify:boolean);
  114. procedure setverify(verify : boolean);
  115. function DiskFree (Drive: byte) : int64;
  116. function DiskSize (Drive: byte) : int64;
  117. procedure findfirst(const path:pathstr;attr:word;var f:searchRec);
  118. procedure findnext(var f:searchRec);
  119. procedure findclose(var f:searchRec);
  120. {Is a dummy:}
  121. procedure swapvectors;
  122. {Not supported:
  123. procedure getintvec(intno:byte;var vector:pointer);
  124. procedure setintvec(intno:byte;vector:pointer);
  125. procedure keep(exitcode:word);
  126. procedure msdos(var regs:registers);
  127. procedure intr(intno : byte;var regs:registers);
  128. }
  129. procedure getfattr(var f;var attr:word);
  130. procedure setfattr(var f;attr:word);
  131. function fsearch(path:pathstr;dirlist:string):pathstr;
  132. procedure getftime(var f;var time:longint);
  133. procedure setftime(var f;time:longint);
  134. procedure packtime (var d:datetime; var time:longint);
  135. procedure unpacktime (time:longint; var d:datetime);
  136. function fexpand(const path:pathstr):pathstr;
  137. procedure fsplit(path:pathstr;var dir:dirstr;var name:namestr;
  138. var ext:extstr);
  139. procedure exec(const path:pathstr;const comline:comstr);
  140. function exec(path:pathstr;runflags:execrunflags;winflags:execwinflags;
  141. const comline:comstr):longint;
  142. function envcount:longint;
  143. function envstr(index:longint) : string;
  144. function GetEnvPChar (EnvVar: string): PChar;
  145. function getenv(const envvar:string): string;
  146. implementation
  147. var LastSR: SearchRec;
  148. type TBA = array [1..SizeOf (SearchRec)] of byte;
  149. PBA = ^TBA;
  150. const FindResvdMask = $00003737; {Allowed bits in attribute
  151. specification for DosFindFirst call.}
  152. function fsearch(path:pathstr;dirlist:string):pathstr;
  153. Var
  154. A: array [0..255] of char;
  155. D, P: AnsiString;
  156. begin
  157. P:=Path;
  158. D:=DirList;
  159. DosError:=DosSearchPath(0, PChar(D), PChar(P), @A, 255);
  160. fsearch := StrPas (@A);
  161. end;
  162. procedure getftime(var f;var time:longint);
  163. var
  164. FStat: TFileStatus3;
  165. begin
  166. DosError := DosQueryFileInfo (FileRec (F).Handle, ilStandard, @FStat,
  167. SizeOf (FStat));
  168. If DosError=0 then
  169. Time := FStat.TimeLastWrite + FStat.DateLastWrite * 256
  170. else
  171. Time:=0;
  172. end;
  173. procedure SetFTime (var F; Time: longint);
  174. var FStat: TFileStatus3;
  175. RC: cardinal;
  176. begin
  177. RC := DosQueryFileInfo (FileRec (F).Handle, ilStandard, @FStat,
  178. SizeOf (FStat));
  179. if RC = 0 then
  180. begin
  181. FStat.DateLastAccess := Hi (Time);
  182. FStat.DateLastWrite := Hi (Time);
  183. FStat.TimeLastAccess := Lo (Time);
  184. FStat.TimeLastWrite := Lo (Time);
  185. RC := DosSetFileInfo (FileRec (F).Handle, ilStandard, @FStat,
  186. SizeOf (FStat));
  187. end;
  188. DosError := integer (RC);
  189. end;
  190. procedure exec(const path:pathstr;const comline:comstr);
  191. {Execute a program.}
  192. begin
  193. dosexitcode:=word(exec(path,execrunflags(ExecFlags),efdefault,comline));
  194. end;
  195. function exec(path:pathstr;runflags:execrunflags;winflags:execwinflags;
  196. const comline:comstr):longint;
  197. {Execute a program. More suitable for OS/2 than the exec above.}
  198. var args:Pbytearray;
  199. env:Pbytearray;
  200. i,argsize:word;
  201. esadr:pointer;
  202. d:dirstr;
  203. n:namestr;
  204. e:extstr;
  205. p : ppchar;
  206. j : integer;
  207. res: TResultCodes;
  208. ObjName: String;
  209. const
  210. ArgsSize = 2048; (* Amount of memory reserved for arguments in bytes. *)
  211. begin
  212. getmem(args,ArgsSize);
  213. GetMem(env, envc*sizeof(pchar)+16384);
  214. {Now setup the arguments. The first argument should be the program
  215. name without directory and extension.}
  216. fsplit(path,d,n,e);
  217. // args^[0]:=$80;
  218. argsize:=0;
  219. for i:=1 to length(n) do
  220. begin
  221. args^[argsize]:=byte(n[i]);
  222. inc(argsize);
  223. end;
  224. args^[argsize]:=0;
  225. inc(argsize);
  226. {Now do the real arguments.}
  227. i:=1;
  228. while i<=length(comline) do
  229. begin
  230. if comline[i]<>' ' then
  231. begin
  232. {Commandline argument found. Copy it.}
  233. // args^[argsize]:=$80;
  234. // inc(argsize);
  235. while (i<=length(comline)) and (comline[i]<>' ') do
  236. begin
  237. args^[argsize]:=byte(comline[i]);
  238. inc(argsize);
  239. inc(i);
  240. end;
  241. args^[argsize]:=32;//0;
  242. inc(argsize);
  243. end;
  244. inc(i);
  245. end;
  246. args^[argsize]:=0;
  247. inc(argsize);
  248. {Commandline ready, now build the environment.
  249. Oh boy, I always had the opinion that executing a program under Dos
  250. was a hard job!}
  251. asm
  252. movl env,%edi {Setup destination pointer.}
  253. movl envc,%ecx {Load number of arguments in edx.}
  254. movl envp,%esi {Load env. strings.}
  255. xorl %edx,%edx {Count environment size.}
  256. .Lexa1:
  257. lodsl {Load a Pchar.}
  258. xchgl %eax,%ebx
  259. .Lexa2:
  260. movb (%ebx),%al {Load a byte.}
  261. incl %ebx {Point to next byte.}
  262. stosb {Store it.}
  263. incl %edx {Increase counter.}
  264. cmpb $0,%al {Ready ?.}
  265. jne .Lexa2
  266. loop .Lexa1 {Next argument.}
  267. stosb {Store an extra 0 to finish. (AL is now 0).}
  268. incl %edx
  269. // movw %dx,ES.SizeEnv {Store environment size.}
  270. end ['eax','ebx','ecx','edx','esi','edi'];
  271. //Not clear how to use
  272. exec:=DosExecPgm(ObjName, cardinal (RunFlags), Args, Env, Res, Path);
  273. freemem(args,ArgsSize);
  274. FreeMem(env, envc*sizeof(pchar)+16384);
  275. {Phew! That's it. This was the most sophisticated procedure to call
  276. a system function I ever wrote!}
  277. end;
  278. function dosversion:word;
  279. {Returns OS/2 version}
  280. var
  281. Minor, Major: Cardinal;
  282. begin
  283. DosQuerySysInfo(svMajorVersion, svMajorVersion, Major, 4);
  284. DosQuerySysInfo(svMinorVersion, svMinorVersion, Minor, 4);
  285. DosVersion:=Major or Minor shl 8;
  286. end;
  287. procedure GetDate (var Year, Month, Day, DayOfWeek: word);
  288. Var
  289. dt: TDateTime;
  290. begin
  291. DosGetDateTime(dt);
  292. Year:=dt.year;
  293. Month:=dt.month;
  294. Day:=dt.Day;
  295. DayofWeek:=dt.Weekday;
  296. end;
  297. procedure SetDate (Year, Month, Day: word);
  298. var
  299. DT: TDateTime;
  300. begin
  301. DosGetDateTime (DT);
  302. DT.Year := Year;
  303. DT.Month := byte (Month);
  304. DT.Day := byte (Day);
  305. DosSetDateTime (DT);
  306. end;
  307. procedure GetTime (var Hour, Minute, Second, Sec100: word);
  308. var
  309. dt: TDateTime;
  310. begin
  311. DosGetDateTime(dt);
  312. Hour:=dt.Hour;
  313. Minute:=dt.Minute;
  314. Second:=dt.Second;
  315. Sec100:=dt.Hundredths;
  316. end;
  317. procedure SetTime (Hour, Minute, Second, Sec100: word);
  318. var
  319. DT: TDateTime;
  320. begin
  321. DosGetDateTime (DT);
  322. DT.Hour := byte (Hour);
  323. DT.Minute := byte (Minute);
  324. DT.Second := byte (Second);
  325. DT.Sec100 := byte (Sec100);
  326. DosSetDateTime (DT);
  327. end;
  328. procedure getcbreak(var breakvalue:boolean);
  329. begin
  330. breakvalue := True;
  331. end;
  332. procedure setcbreak(breakvalue:boolean);
  333. begin
  334. end;
  335. procedure getverify(var verify:boolean);
  336. begin
  337. verify := true;
  338. end;
  339. procedure setverify(verify:boolean);
  340. begin
  341. end;
  342. function DiskFree (Drive: byte): int64;
  343. var FI: TFSinfo;
  344. RC: cardinal;
  345. begin
  346. {In OS/2, we use the filesystem information.}
  347. RC := DosQueryFSInfo (Drive, 1, FI, SizeOf (FI));
  348. if RC = 0 then
  349. DiskFree := int64 (FI.Free_Clusters) *
  350. int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector)
  351. else
  352. DiskFree := -1;
  353. end;
  354. function DiskSize (Drive: byte): int64;
  355. var FI: TFSinfo;
  356. RC: cardinal;
  357. begin
  358. RC := DosQueryFSinfo (Drive, 1, FI, SizeOf (FI));
  359. if RC = 0 then
  360. DiskSize := int64 (FI.Total_Clusters) *
  361. int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector)
  362. else
  363. DiskSize := -1;
  364. end;
  365. procedure SearchRec2DosSearchRec (var F: SearchRec);
  366. begin
  367. end;
  368. procedure DosSearchRec2SearchRec (var F: SearchRec);
  369. type
  370. TRec = record
  371. T, D: word;
  372. end;
  373. begin
  374. with F do
  375. begin
  376. Name := FStat^.Name;
  377. Size := FStat^.FileSize;
  378. Attr := byte(FStat^.AttrFile and $FF);
  379. TRec (Time).T := FStat^.TimeLastWrite;
  380. TRec (Time).D := FStat^.DateLastWrite;
  381. end;
  382. end;
  383. procedure FindFirst (const Path: PathStr; Attr: word; var F: SearchRec);
  384. var Count: cardinal;
  385. begin
  386. {No error.}
  387. DosError := 0;
  388. New (F.FStat);
  389. F.Handle := longint ($FFFFFFFF);
  390. Count := 1;
  391. DosError := integer (DosFindFirst (Path, F.Handle,
  392. Attr and FindResvdMask, F.FStat, SizeOf (F.FStat^),
  393. Count, ilStandard));
  394. if (DosError = 0) and (Count = 0) then DosError := 18;
  395. DosSearchRec2SearchRec (F);
  396. end;
  397. procedure FindNext (var F: SearchRec);
  398. var
  399. Count: cardinal;
  400. begin
  401. {No error}
  402. DosError := 0;
  403. SearchRec2DosSearchRec (F);
  404. Count := 1;
  405. DosError := integer (DosFindNext (F.Handle, F.FStat, SizeOf (F.FStat^),
  406. Count));
  407. if (DosError = 0) and (Count = 0) then DosError := 18;
  408. DosSearchRec2SearchRec (F);
  409. end;
  410. procedure FindClose (var F: SearchRec);
  411. begin
  412. if F.Handle <> $FFFFFFFF then DosError := DosFindClose (F.Handle);
  413. Dispose (F.FStat);
  414. end;
  415. procedure swapvectors;
  416. {For TP compatibility, this exists.}
  417. begin
  418. end;
  419. function envcount:longint;
  420. begin
  421. envcount:=envc;
  422. end;
  423. function envstr(index : longint) : string;
  424. var hp:Pchar;
  425. begin
  426. if (index<=0) or (index>envcount) then
  427. begin
  428. envstr:='';
  429. exit;
  430. end;
  431. hp:=EnvP[index-1];
  432. envstr:=strpas(hp);
  433. end;
  434. function GetEnvPChar (EnvVar: string): PChar;
  435. (* The assembler version is more than three times as fast as Pascal. *)
  436. var
  437. P: PChar;
  438. begin
  439. EnvVar := UpCase (EnvVar);
  440. {$ASMMODE INTEL}
  441. asm
  442. cld
  443. mov edi, Environment
  444. lea esi, EnvVar
  445. xor eax, eax
  446. lodsb
  447. @NewVar:
  448. cmp byte ptr [edi], 0
  449. jz @Stop
  450. push eax { eax contains length of searched variable name }
  451. push esi { esi points to the beginning of the variable name }
  452. mov ecx, -1 { our character ('=' - see below) _must_ be found }
  453. mov edx, edi { pointer to beginning of variable name saved in edx }
  454. mov al, '=' { searching until '=' (end of variable name) }
  455. repne
  456. scasb { scan until '=' not found }
  457. neg ecx { what was the name length? }
  458. dec ecx { corrected }
  459. dec ecx { exclude the '=' character }
  460. pop esi { restore pointer to beginning of variable name }
  461. pop eax { restore length of searched variable name }
  462. push eax { and save both of them again for later use }
  463. push esi
  464. cmp ecx, eax { compare length of searched variable name with name }
  465. jnz @NotEqual { ... of currently found variable, jump if different }
  466. xchg edx, edi { pointer to current variable name restored in edi }
  467. repe
  468. cmpsb { compare till the end of variable name }
  469. xchg edx, edi { pointer to beginning of variable contents in edi }
  470. jz @Equal { finish if they're equal }
  471. @NotEqual:
  472. xor eax, eax { look for 00h }
  473. mov ecx, -1 { it _must_ be found }
  474. repne
  475. scasb { scan until found }
  476. pop esi { restore pointer to beginning of variable name }
  477. pop eax { restore length of searched variable name }
  478. jmp @NewVar { ... or continue with new variable otherwise }
  479. @Stop:
  480. xor eax, eax
  481. mov P, eax { Not found - return nil }
  482. jmp @End
  483. @Equal:
  484. pop esi { restore the stack position }
  485. pop eax
  486. mov P, edi { place pointer to variable contents in P }
  487. @End:
  488. end ['eax','ecx','edx','esi','edi'];
  489. GetEnvPChar := P;
  490. end;
  491. {$ASMMODE ATT}
  492. function GetEnv (const EnvVar: string): string;
  493. (* The assembler version is more than three times as fast as Pascal. *)
  494. begin
  495. GetEnv := StrPas (GetEnvPChar (EnvVar));
  496. end;
  497. procedure fsplit(path:pathstr;var dir:dirstr;var name:namestr;
  498. var ext:extstr);
  499. var p1,i : longint;
  500. dotpos : integer;
  501. begin
  502. { allow slash as backslash }
  503. for i:=1 to length(path) do
  504. if path[i]='/' then path[i]:='\';
  505. {Get drive name}
  506. p1:=pos(':',path);
  507. if p1>0 then
  508. begin
  509. dir:=path[1]+':';
  510. delete(path,1,p1);
  511. end
  512. else
  513. dir:='';
  514. { split the path and the name, there are no more path informtions }
  515. { if path contains no backslashes }
  516. while true do
  517. begin
  518. p1:=pos('\',path);
  519. if p1=0 then
  520. break;
  521. dir:=dir+copy(path,1,p1);
  522. delete(path,1,p1);
  523. end;
  524. { try to find out a extension }
  525. Ext:='';
  526. i:=Length(Path);
  527. DotPos:=256;
  528. While (i>0) Do
  529. Begin
  530. If (Path[i]='.') Then
  531. begin
  532. DotPos:=i;
  533. break;
  534. end;
  535. Dec(i);
  536. end;
  537. Ext:=Copy(Path,DotPos,255);
  538. Name:=Copy(Path,1,DotPos - 1);
  539. end;
  540. (*
  541. function FExpand (const Path: PathStr): PathStr;
  542. - declared in fexpand.inc
  543. *)
  544. {$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
  545. {$DEFINE FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
  546. {$I fexpand.inc}
  547. {$UNDEF FPC_FEXPAND_DRIVES}
  548. {$UNDEF FPC_FEXPAND_UNC}
  549. procedure packtime(var d:datetime;var time:longint);
  550. var zs:longint;
  551. begin
  552. time:=-1980;
  553. time:=time+d.year and 127;
  554. time:=time shl 4;
  555. time:=time+d.month;
  556. time:=time shl 5;
  557. time:=time+d.day;
  558. time:=time shl 16;
  559. zs:=d.hour;
  560. zs:=zs shl 6;
  561. zs:=zs+d.min;
  562. zs:=zs shl 5;
  563. zs:=zs+d.sec div 2;
  564. time:=time+(zs and $ffff);
  565. end;
  566. procedure unpacktime (time:longint;var d:datetime);
  567. begin
  568. d.sec:=(time and 31) * 2;
  569. time:=time shr 5;
  570. d.min:=time and 63;
  571. time:=time shr 6;
  572. d.hour:=time and 31;
  573. time:=time shr 5;
  574. d.day:=time and 31;
  575. time:=time shr 5;
  576. d.month:=time and 15;
  577. time:=time shr 4;
  578. d.year:=time+1980;
  579. end;
  580. procedure GetFAttr (var F; var Attr: word);
  581. var
  582. PathInfo: TFileStatus3;
  583. RC: cardinal;
  584. begin
  585. Attr := 0;
  586. RC := DosQueryPathInfo (FileRec (F).Name, ilStandard,
  587. @PathInfo, SizeOf (PathInfo));
  588. DosError := integer (RC);
  589. if RC = 0 then
  590. Attr := PathInfo.AttrFile;
  591. end;
  592. procedure SetFAttr (var F; Attr: word);
  593. var
  594. PathInfo: TFileStatus3;
  595. RC: cardinal;
  596. begin
  597. RC := DosQueryPathInfo (FileRec (F).Name, ilStandard,
  598. @PathInfo, SizeOf (PathInfo));
  599. if RC = 0 then
  600. begin
  601. PathInfo.AttrFile := Attr;
  602. RC := DosSetPathInfo (FileRec (F).Name, ilStandard, @PathInfo,
  603. SizeOf (PathInfo), doWriteThru);
  604. end;
  605. DosError := integer (RC);
  606. end;
  607. end.
  608. {
  609. $Log$
  610. Revision 1.30 2003-10-25 23:55:22 hajny
  611. * Exec fix
  612. Revision 1.29 2003/10/25 22:45:37 hajny
  613. * file handling related fixes
  614. Revision 1.28 2003/10/05 22:06:43 hajny
  615. * result buffers must be allocated
  616. Revision 1.27 2003/10/03 21:46:41 peter
  617. * stdcall fixes
  618. Revision 1.26 2003/09/24 08:59:16 yuri
  619. * Prepared for native target (emx code replaced)
  620. Revision 1.25 2003/02/20 17:37:00 hajny
  621. * correction for previous mistyping
  622. Revision 1.24 2003/02/20 17:09:49 hajny
  623. * fixes for OS/2 v2.1 incompatibility
  624. Revision 1.23 2003/01/04 15:43:50 hajny
  625. + GetEnvPChar added
  626. Revision 1.22 2002/12/07 19:46:56 hajny
  627. * mistyping fixed
  628. Revision 1.21 2002/12/07 19:17:13 hajny
  629. * GetEnv correction, better PM support, ...
  630. Revision 1.20 2002/11/18 19:51:00 hajny
  631. * another bunch of type corrections
  632. Revision 1.19 2002/09/07 16:01:24 peter
  633. * old logs removed and tabs fixed
  634. Revision 1.18 2002/07/11 16:00:05 hajny
  635. * FindFirst fix (invalid attribute bits masked out)
  636. Revision 1.17 2002/07/07 18:00:48 hajny
  637. * DosGetInfoBlock modification to allow overloaded version (in DosCalls)
  638. Revision 1.16 2002/03/03 11:19:20 hajny
  639. * GetEnv rewritten to assembly - 3x faster now
  640. }