dos.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  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. R: PChar;
  155. D, P: AnsiString;
  156. begin
  157. P:=Path;
  158. D:=DirList;
  159. DosError:=DosSearchPath(0, PChar(D), PChar(P), R, 255);
  160. fsearch:=R;
  161. end;
  162. procedure getftime(var f;var time:longint);
  163. var
  164. FStat: PFileStatus3;
  165. begin
  166. DosError:=DosQueryFileInfo(FileRec(F).Handle, 1, FStat, SizeOf(FStat^));
  167. If DosError=0 then
  168. Time:=FStat^.timelastwrite+FStat^.DateLastWrite*256
  169. else
  170. Time:=0;
  171. end;
  172. procedure SetFTime (var F; Time: longint);
  173. var FStat: PFileStatus3;
  174. RC: longint;
  175. begin
  176. New (FStat);
  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,
  186. FStat, SizeOf (FStat^));
  187. end;
  188. DosError := integer(RC);
  189. Dispose (FStat);
  190. end;
  191. procedure exec(const path:pathstr;const comline:comstr);
  192. {Execute a program.}
  193. begin
  194. dosexitcode:=word(exec(path,execrunflags(ExecFlags),efdefault,comline));
  195. end;
  196. function exec(path:pathstr;runflags:execrunflags;winflags:execwinflags;
  197. const comline:comstr):longint;
  198. {Execute a program. More suitable for OS/2 than the exec above.}
  199. var args:Pbytearray;
  200. env:Pbytearray;
  201. i,argsize:word;
  202. esadr:pointer;
  203. d:dirstr;
  204. n:namestr;
  205. e:extstr;
  206. p : ppchar;
  207. j : integer;
  208. res: TResultCodes;
  209. ObjName: String;
  210. const
  211. ArgsSize = 2048; (* Amount of memory reserved for arguments in bytes. *)
  212. begin
  213. getmem(args,ArgsSize);
  214. GetMem(env, envc*sizeof(pchar)+16384);
  215. {Now setup the arguments. The first argument should be the program
  216. name without directory and extension.}
  217. fsplit(path,d,n,e);
  218. // args^[0]:=$80;
  219. argsize:=0;
  220. for i:=1 to length(n) do
  221. begin
  222. args^[argsize]:=byte(n[i]);
  223. inc(argsize);
  224. end;
  225. args^[argsize]:=0;
  226. inc(argsize);
  227. {Now do the real arguments.}
  228. i:=1;
  229. while i<=length(comline) do
  230. begin
  231. if comline[i]<>' ' then
  232. begin
  233. {Commandline argument found. Copy it.}
  234. // args^[argsize]:=$80;
  235. // inc(argsize);
  236. while (i<=length(comline)) and (comline[i]<>' ') do
  237. begin
  238. args^[argsize]:=byte(comline[i]);
  239. inc(argsize);
  240. inc(i);
  241. end;
  242. args^[argsize]:=32;//0;
  243. inc(argsize);
  244. end;
  245. inc(i);
  246. end;
  247. args^[argsize]:=0;
  248. inc(argsize);
  249. {Commandline ready, now build the environment.
  250. Oh boy, I always had the opinion that executing a program under Dos
  251. was a hard job!}
  252. asm
  253. movl env,%edi {Setup destination pointer.}
  254. movl envc,%ecx {Load number of arguments in edx.}
  255. movl envp,%esi {Load env. strings.}
  256. xorl %edx,%edx {Count environment size.}
  257. .Lexa1:
  258. lodsl {Load a Pchar.}
  259. xchgl %eax,%ebx
  260. .Lexa2:
  261. movb (%ebx),%al {Load a byte.}
  262. incl %ebx {Point to next byte.}
  263. stosb {Store it.}
  264. incl %edx {Increase counter.}
  265. cmpb $0,%al {Ready ?.}
  266. jne .Lexa2
  267. loop .Lexa1 {Next argument.}
  268. stosb {Store an extra 0 to finish. (AL is now 0).}
  269. incl %edx
  270. // movw %dx,ES.SizeEnv {Store environment size.}
  271. end;
  272. //Not clear how to use
  273. exec:=DosExecPgm(ObjName, Longint(runflags), Args, Env, Res, Path);
  274. freemem(args,ArgsSize);
  275. FreeMem(env, envc*sizeof(pchar)+16384);
  276. {Phew! That's it. This was the most sophisticated procedure to call
  277. a system function I ever wrote!}
  278. end;
  279. function dosversion:word;
  280. {Returns OS/2 version}
  281. var
  282. Minor, Major: Cardinal;
  283. begin
  284. DosQuerySysInfo(svMajorVersion, svMajorVersion, Major, 4);
  285. DosQuerySysInfo(svMinorVersion, svMinorVersion, Minor, 4);
  286. DosVersion:=Major or Minor shl 8;
  287. end;
  288. procedure GetDate (var Year, Month, Day, DayOfWeek: word);
  289. Var
  290. dt: TDateTime;
  291. begin
  292. DosGetDateTime(dt);
  293. Year:=dt.year;
  294. Month:=dt.month;
  295. Day:=dt.Day;
  296. DayofWeek:=dt.Weekday;
  297. end;
  298. procedure SetDate (Year, Month, Day: word);
  299. var
  300. DT: TDateTime;
  301. begin
  302. DosGetDateTime (DT);
  303. DT.Year := Year;
  304. DT.Month := byte (Month);
  305. DT.Day := byte (Day);
  306. DosSetDateTime (DT);
  307. end;
  308. procedure GetTime (var Hour, Minute, Second, Sec100: word);
  309. var
  310. dt: TDateTime;
  311. begin
  312. DosGetDateTime(dt);
  313. Hour:=dt.Hour;
  314. Minute:=dt.Minute;
  315. Second:=dt.Second;
  316. Sec100:=dt.Hundredths;
  317. end;
  318. procedure SetTime (Hour, Minute, Second, Sec100: word);
  319. var
  320. DT: TDateTime;
  321. begin
  322. DosGetDateTime (DT);
  323. DT.Hour := byte (Hour);
  324. DT.Minute := byte (Minute);
  325. DT.Second := byte (Second);
  326. DT.Sec100 := byte (Sec100);
  327. DosSetDateTime (DT);
  328. end;
  329. procedure getcbreak(var breakvalue:boolean);
  330. begin
  331. breakvalue := True;
  332. end;
  333. procedure setcbreak(breakvalue:boolean);
  334. begin
  335. end;
  336. procedure getverify(var verify:boolean);
  337. begin
  338. verify := true;
  339. end;
  340. procedure setverify(verify:boolean);
  341. begin
  342. end;
  343. function DiskFree (Drive: byte): int64;
  344. var FI: TFSinfo;
  345. RC: longint;
  346. begin
  347. {In OS/2, we use the filesystem information.}
  348. RC := DosQueryFSInfo (Drive, 1, FI, SizeOf (FI));
  349. if RC = 0 then
  350. DiskFree := int64 (FI.Free_Clusters) *
  351. int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector)
  352. else
  353. DiskFree := -1;
  354. end;
  355. function DiskSize (Drive: byte): int64;
  356. var FI: TFSinfo;
  357. RC: longint;
  358. begin
  359. RC := DosQueryFSinfo (Drive, 1, FI, SizeOf (FI));
  360. if RC = 0 then
  361. DiskSize := int64 (FI.Total_Clusters) *
  362. int64 (FI.Sectors_Per_Cluster) * int64 (FI.Bytes_Per_Sector)
  363. else
  364. DiskSize := -1;
  365. end;
  366. procedure SearchRec2DosSearchRec (var F: SearchRec);
  367. begin
  368. end;
  369. procedure DosSearchRec2SearchRec (var F: SearchRec);
  370. const
  371. NameSize=255;
  372. var
  373. L, I: longint;
  374. type
  375. TRec = record
  376. T, D: word;
  377. end;
  378. begin
  379. with F do
  380. begin
  381. Name := FStat^.Name;
  382. Size := FStat^.FileSize;
  383. Attr := byte(FStat^.AttrFile and $FF);
  384. TRec (Time).T := FStat^.TimeLastWrite;
  385. TRec (Time).D := FStat^.DateLastWrite;
  386. end;
  387. end;
  388. procedure FindFirst (const Path: PathStr; Attr: word; var F: SearchRec);
  389. var path0: array[0..255] of char;
  390. Count: cardinal;
  391. begin
  392. {No error.}
  393. DosError := 0;
  394. New (F.FStat);
  395. F.Handle := longint ($FFFFFFFF);
  396. Count := 1;
  397. DosError := integer (DosFindFirst (Path, F.Handle,
  398. Attr and FindResvdMask, F.FStat, SizeOf (F.FStat^),
  399. Count, ilStandard));
  400. if (DosError = 0) and (Count = 0) then DosError := 18;
  401. DosSearchRec2SearchRec (F);
  402. end;
  403. procedure FindNext (var F: SearchRec);
  404. var
  405. Count: cardinal;
  406. begin
  407. {No error}
  408. DosError := 0;
  409. SearchRec2DosSearchRec (F);
  410. Count := 1;
  411. DosError := integer (DosFindNext (F.Handle, F.FStat, SizeOf (F.FStat^),
  412. Count));
  413. if (DosError = 0) and (Count = 0) then DosError := 18;
  414. DosSearchRec2SearchRec (F);
  415. end;
  416. procedure FindClose (var F: SearchRec);
  417. begin
  418. if F.Handle <> $FFFFFFFF then DosError := DosFindClose (F.Handle);
  419. Dispose (F.FStat);
  420. end;
  421. procedure swapvectors;
  422. {For TP compatibility, this exists.}
  423. begin
  424. end;
  425. function envcount:longint;
  426. begin
  427. envcount:=envc;
  428. end;
  429. function envstr(index : longint) : string;
  430. var hp:Pchar;
  431. begin
  432. if (index<=0) or (index>envcount) then
  433. begin
  434. envstr:='';
  435. exit;
  436. end;
  437. hp:=EnvP[index-1];
  438. envstr:=strpas(hp);
  439. end;
  440. function GetEnvPChar (EnvVar: string): PChar;
  441. (* The assembler version is more than three times as fast as Pascal. *)
  442. var
  443. P: PChar;
  444. begin
  445. EnvVar := UpCase (EnvVar);
  446. {$ASMMODE INTEL}
  447. asm
  448. cld
  449. mov edi, Environment
  450. lea esi, EnvVar
  451. xor eax, eax
  452. lodsb
  453. @NewVar:
  454. cmp byte ptr [edi], 0
  455. jz @Stop
  456. push eax { eax contains length of searched variable name }
  457. push esi { esi points to the beginning of the variable name }
  458. mov ecx, -1 { our character ('=' - see below) _must_ be found }
  459. mov edx, edi { pointer to beginning of variable name saved in edx }
  460. mov al, '=' { searching until '=' (end of variable name) }
  461. repne
  462. scasb { scan until '=' not found }
  463. neg ecx { what was the name length? }
  464. dec ecx { corrected }
  465. dec ecx { exclude the '=' character }
  466. pop esi { restore pointer to beginning of variable name }
  467. pop eax { restore length of searched variable name }
  468. push eax { and save both of them again for later use }
  469. push esi
  470. cmp ecx, eax { compare length of searched variable name with name }
  471. jnz @NotEqual { ... of currently found variable, jump if different }
  472. xchg edx, edi { pointer to current variable name restored in edi }
  473. repe
  474. cmpsb { compare till the end of variable name }
  475. xchg edx, edi { pointer to beginning of variable contents in edi }
  476. jz @Equal { finish if they're equal }
  477. @NotEqual:
  478. xor eax, eax { look for 00h }
  479. mov ecx, -1 { it _must_ be found }
  480. repne
  481. scasb { scan until found }
  482. pop esi { restore pointer to beginning of variable name }
  483. pop eax { restore length of searched variable name }
  484. jmp @NewVar { ... or continue with new variable otherwise }
  485. @Stop:
  486. xor eax, eax
  487. mov P, eax { Not found - return nil }
  488. jmp @End
  489. @Equal:
  490. pop esi { restore the stack position }
  491. pop eax
  492. mov P, edi { place pointer to variable contents in P }
  493. @End:
  494. end;
  495. GetEnvPChar := P;
  496. end;
  497. {$ASMMODE ATT}
  498. function GetEnv (const EnvVar: string): string;
  499. (* The assembler version is more than three times as fast as Pascal. *)
  500. begin
  501. GetEnv := StrPas (GetEnvPChar (EnvVar));
  502. end;
  503. {$ASMMODE ATT}
  504. procedure fsplit(path:pathstr;var dir:dirstr;var name:namestr;
  505. var ext:extstr);
  506. var p1,i : longint;
  507. dotpos : integer;
  508. begin
  509. { allow slash as backslash }
  510. for i:=1 to length(path) do
  511. if path[i]='/' then path[i]:='\';
  512. {Get drive name}
  513. p1:=pos(':',path);
  514. if p1>0 then
  515. begin
  516. dir:=path[1]+':';
  517. delete(path,1,p1);
  518. end
  519. else
  520. dir:='';
  521. { split the path and the name, there are no more path informtions }
  522. { if path contains no backslashes }
  523. while true do
  524. begin
  525. p1:=pos('\',path);
  526. if p1=0 then
  527. break;
  528. dir:=dir+copy(path,1,p1);
  529. delete(path,1,p1);
  530. end;
  531. { try to find out a extension }
  532. Ext:='';
  533. i:=Length(Path);
  534. DotPos:=256;
  535. While (i>0) Do
  536. Begin
  537. If (Path[i]='.') Then
  538. begin
  539. DotPos:=i;
  540. break;
  541. end;
  542. Dec(i);
  543. end;
  544. Ext:=Copy(Path,DotPos,255);
  545. Name:=Copy(Path,1,DotPos - 1);
  546. end;
  547. (*
  548. function FExpand (const Path: PathStr): PathStr;
  549. - declared in fexpand.inc
  550. *)
  551. {$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
  552. {$DEFINE FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
  553. const
  554. LFNSupport = true;
  555. {$I fexpand.inc}
  556. {$UNDEF FPC_FEXPAND_DRIVES}
  557. {$UNDEF FPC_FEXPAND_UNC}
  558. procedure packtime(var d:datetime;var time:longint);
  559. var zs:longint;
  560. begin
  561. time:=-1980;
  562. time:=time+d.year and 127;
  563. time:=time shl 4;
  564. time:=time+d.month;
  565. time:=time shl 5;
  566. time:=time+d.day;
  567. time:=time shl 16;
  568. zs:=d.hour;
  569. zs:=zs shl 6;
  570. zs:=zs+d.min;
  571. zs:=zs shl 5;
  572. zs:=zs+d.sec div 2;
  573. time:=time+(zs and $ffff);
  574. end;
  575. procedure unpacktime (time:longint;var d:datetime);
  576. begin
  577. d.sec:=(time and 31) * 2;
  578. time:=time shr 5;
  579. d.min:=time and 63;
  580. time:=time shr 6;
  581. d.hour:=time and 31;
  582. time:=time shr 5;
  583. d.day:=time and 31;
  584. time:=time shr 5;
  585. d.month:=time and 15;
  586. time:=time shr 4;
  587. d.year:=time+1980;
  588. end;
  589. procedure getfattr(var f;var attr : word);
  590. var
  591. PathInfo: PFileStatus3;
  592. begin
  593. Attr:=0;
  594. DosError:=DosQueryPathInfo(FileRec(F).Name, ilStandard, PathInfo, SizeOf(PathInfo^));
  595. if DosError=0 then
  596. Attr := PathInfo^.attrFile;
  597. end;
  598. procedure setfattr(var f;attr : word);
  599. var
  600. PathInfo: PFileStatus3;
  601. begin
  602. DosError:=DosQueryPathInfo(FileRec(F).Name, ilStandard, PathInfo, SizeOf(PathInfo^));
  603. if DosError=0 then
  604. begin
  605. PathInfo^.attrFile:=Attr;
  606. DosError:=DosSetPathInfo(FileRec(F).Name, ilStandard, PathInfo, SizeOf(PathInfo^), doWriteThru);
  607. end;
  608. end;
  609. begin
  610. end.
  611. {
  612. $Log$
  613. Revision 1.26 2003-09-24 08:59:16 yuri
  614. * Prepared for native target (emx code replaced)
  615. Revision 1.25 2003/02/20 17:37:00 hajny
  616. * correction for previous mistyping
  617. Revision 1.24 2003/02/20 17:09:49 hajny
  618. * fixes for OS/2 v2.1 incompatibility
  619. Revision 1.23 2003/01/04 15:43:50 hajny
  620. + GetEnvPChar added
  621. Revision 1.22 2002/12/07 19:46:56 hajny
  622. * mistyping fixed
  623. Revision 1.21 2002/12/07 19:17:13 hajny
  624. * GetEnv correction, better PM support, ...
  625. Revision 1.20 2002/11/18 19:51:00 hajny
  626. * another bunch of type corrections
  627. Revision 1.19 2002/09/07 16:01:24 peter
  628. * old logs removed and tabs fixed
  629. Revision 1.18 2002/07/11 16:00:05 hajny
  630. * FindFirst fix (invalid attribute bits masked out)
  631. Revision 1.17 2002/07/07 18:00:48 hajny
  632. * DosGetInfoBlock modification to allow overloaded version (in DosCalls)
  633. Revision 1.16 2002/03/03 11:19:20 hajny
  634. * GetEnv rewritten to assembly - 3x faster now
  635. }