D.LST 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572
  1. Listing:
  2. 1 MODULE D;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1990 PMI
  8. 7 * Green Bay Wisconsin
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 * $Header: D:/logfiles/demos/d.mov 1.2 03 Dec 1990 07:01:24 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15
  17. 16
  18. 17 (*
  19. 18 Directory Management With D.MOD
  20. 19
  21. 20 D.MOD is a sample director manager. Its purpose is
  22. 21 to illustrate the use of Repertoire's Drectory module.
  23. 22 See section 7.10. It makes more convenient the four most
  24. 23 frequently performed operations in the PC/MS-DOS
  25. 24 operating system: listing, deleting, renaming, and
  26. 25 copying files. It lists directories using both the left
  27. 26 and right sides of the screen; it allows prompted file
  28. 27 erasure; it allows prompted renaming and directory-
  29. 28 shifting of files; and it allows prompted file copying
  30. 29 and moving with safety checks to prevent accidental
  31. 30 erasures.
  32. 31
  33. 32
  34. 33 Listing Directories.
  35. 34
  36. 35 To list the entire current directory of the default
  37. 36 drive using both sides of the screen, enter "d" and
  38. 37 press <RETURN>. If the screen fills, the program
  39. 38 suspends the listing until you press a key. Unlike the
  40. 39 MS-DOS DIR /W (wide) command, which lists only file
  41. 40 names, D provides complete information about each file.
  42. 41
  43. 42 To list the entire current directory of a drive
  44. 43 other than the default drive (say, the A: drive), type
  45. 44 "d a" and press <RETURN>. Notice that D does not
  46. 45 require a trailing colon to specify a drive letter--it
  47. 46 assumes that any single-character program parameter is
  48. 47 a drive letter. To list all files with extensions of
  49. 48 .ltr in the subdirectory \letters, enter "d \letters\*.ltr"
  50. 49 or "d letters\*.ltr". If \letters is not on the
  51. 50 default drive, enter "d a:letters\*.ltr" or
  52. 51 "d a:\letters\*.ltr". To list all the files in the
  53. 52 \letters subdirectory, enter "d letters\". The
  54. 53 trailing slash tells D to list a subdirectory instead
  55. 54 of a file in the current directory named letters.
  56. 55
  57. 56 D expands the power of the asterisk as an expansion
  58. 57 character. For example, to list all files beginning
  59. 58 with the letter A, regardless of extension, you need
  60. 59 only enter "a*" as D's command-line parameter.
  61. 60 Entering "art*xt" would list all files beginning with
  62. 61 'art' and ending (in the extension part of the name)
  63. 62 with 'xt'. It would list ARTICLE.TXT, for example, or
  64. 63 ARTWORK.EXT. Multiple asterisks are allowed in a
  65. 64 single command.
  66. 65
  67. 66
  68. 67 Erasing Files.
  69. 68
  70. 69 Suppose you want to erase all documents in the
  71. 70 \letters subdirectory on drive B: that are more than a
  72. 71 year old. Using D, you can enter "d b:\letters\/e" and
  73. 72 press <RETURN>. The trailing /e tells D to invoke its
  74. 73 file-erasing function. D will display a full directory
  75. 74 entry for the first file in the \letters subdirectory,
  76. 75 followed by the prompt "Erase?" If the date indicates
  77. 76 that the file is more than a year old, you can press Y
  78. 77 to erase it. Press N to leave the file on the disk. D
  79. 78 will continue to display directory entries and ask for
  80. 79 permission to erase them until it can find no more
  81. 80 matching files or until you press Q, for quit.
  82. 81
  83. 82
  84. 83 Copying Files.
  85. 84
  86. 85 D allows you to decide both whether to copy each
  87. 86 matching file and whether to destroy any files of the
  88. 87 same name on the destination disk. Suppose, for
  89. 88 example, you want to make sure that two disks each have
  90. 89 the same 30-file set of implementation modules for a
  91. 90 large program you're developing. For each of the 30
  92. 91 files, you have to determine which disk has either the
  93. 92 larger or the more recent version of the file.
  94. 93
  95. 94 On the DOS command line, enter "d a:*imp/c". The
  96. 95 trailing /c tells D that it is to COPY matching files.
  97. 96 The program will ask, "Copy to what drive:\path?"
  98. 97 Enter "b" and press <RETURN>. No trailing colon is
  99. 98 required. You can copy to the current drive by merely
  100. 99 pressing <RETURN>. For each of the 30 implementation
  101. 100 modules on drive A:, D will display complete directory
  102. 101 information and ask, "Copy?" Press Y to copy the file,
  103. 102 N to skip it, and Q to terminate the program.
  104. 103
  105. 104 If you press Y, D will determine whether the
  106. 105 destination disk contains a file of the same name. If
  107. 106 it does, D will display complete directory information
  108. 107 for that file and ask, "Destroy?" You can look at the
  109. 108 date and, if the file on the destination disk is less
  110. 109 recent than the file on the source disk, press Y. If
  111. 110 you press N, D will prompt you to "Enter new name, or
  112. 111 <RETURN> to skip." To copy the file to the destination
  113. 112 disk under a different name, type in the new name and
  114. 113 press <RETURN>. D will again determine whether the
  115. 114 destination disk contains a file of the same name. If
  116. 115 it doesn't, D will copy the file. If you only press
  117. 116 <RETURN> when prompted for a new name, D will not copy
  118. 117 the file on the source disk, and will go to the next
  119. 118 matching file.
  120. 119
  121. 120 After you've answered yes or no to D's prompts on
  122. 121 each of the 30 .MOD files on drive A:, reverse the
  123. 122 process by entering "d b:*.MOD/c" and entering "a" when
  124. 123 asked "Copy to what drive:\path?" Each time D asks
  125. 124 whether you want to destroy a file on drive A:, press N
  126. 125 if the file is identical. At the end of the process
  127. 126 you'll have the most recent 30-file set of
  128. 127 implementation modules on each disk.
  129. 128
  130. 129
  131. 130 Renaming Files.
  132. 131
  133. 132 D allows you to rename files and move them between
  134. 133 directories without recopying them using much the same
  135. 134 syntax that you employ with its other functions. For
  136. 135 example, to move selected files with .LTR extensions
  137. 136 from the root directory of your hard disk to the \LTRS
  138. 137 subdirectory, enter:
  139. 138
  140. 139
  141. 140 C>d *ltr \ltrs\*ltr/r
  142. 141
  143. 142 D will respond as follows:
  144. 143
  145. 144 F1.LTR 50950 2-02-86 8:04p |Rename \ltrs\F1.ltr? no
  146. 145 F3.LTR 23557 2-02-86 1:31p |Rename \ltrs\F3.ltr? yes
  147. 146 F2.LTR 34821 2-02-86 2:59p |Rename \ltrs\F2.ltr? no
  148. 147
  149. 148 C>_
  150. 149
  151. 150
  152. 151 The trailing /r is the command that tells D to
  153. 152 rename the files that match its first command-line
  154. 153 parameter. D renames the files in accordance with the
  155. 154 same rules used in the DOS RENAME operation, with the
  156. 155 exception that D does not require separate asterisks on
  157. 156 each side of the period.
  158. 157
  159. 158
  160. 159 Moving Files
  161. 160
  162. 161 A trailing /m modifies both the renaming and the
  163. 162 copying operations. A trailing /m causes D first to
  164. 163 determine whether the two file specifications are on
  165. 164 different drives. If they are, D copies files to the
  166. 165 destination drive just as it does when you use the /c
  167. 166 command, but it also erases from the source drive any
  168. 167 files that are successfully copied. If the files are on
  169. 168 the same drive, a trailing /m causes D to erase any
  170. 169 conflicting file names from the destination directory;
  171. 170 the rename operation normally aborts if a file of the
  172. 171 same name is in the destination directory.
  173. 172
  174. 173
  175. 174 Batch Mode
  176. 175
  177. 176 A trailing /b causes any yes/no prompt automatically
  178. 177 to be answered Yes.
  179. 178
  180. 179 *)
  181. 180
  182. 181 IMPORT BigSets;
  183. 182 IMPORT Drectory;
  184. 183 IMPORT EnvironUtils;
  185. 184 IMPORT ErrorManager;
  186. 185 IMPORT ErrStrgs;
  187. 186 IMPORT KbdInput;
  188. 187 IMPORT LowLevel;
  189. 188 IMPORT M2Strings;
  190. 189 IMPORT Numbers;
  191. 190 IMPORT HandleIO;
  192. 191 IMPORT FAPI;
  193. 192 IMPORT PosUtils;
  194. 193 IMPORT StrConv;
  195. 194 IMPORT StrEdit;
  196. 195 IMPORT StringIO;
  197. 196 IMPORT SYSTEM;
  198. 197
  199. 198 IMPORT InitCompilerMods;
  200. 199
  201. 200
  202. 201 CONST
  203. 202 blank = ' ';
  204. 203 null = '';
  205. 204 VAR
  206. 205 SecondStr, DirMask: ARRAY [0..79] OF CHAR;
  207. ***** ^ not supported yet
  208. ***** ^ not supported yet
  209. 206 FileInfo: Drectory.FileInfoRec;
  210. ***** ^ not supported yet
  211. 207 BatchMode, exiting, moving, renaming, copying, deleting,
  212. 208 OnTheLeft : BOOLEAN;
  213. 209 SavedMessage : CARDINAL;
  214. 210 TheDrive : CHAR;
  215. 211 BytesPerSector, SectorsPerCluster,
  216. 212 ClustersOnDisk: CARDINAL;
  217. 213 KindOfDisk : Drectory.DiskTypes;
  218. ***** ^ not supported yet
  219. 214 ClusterSize : LONGINT;
  220. 215
  221. 216 PROCEDURE yes() : BOOLEAN;
  222. 217 VAR
  223. 218 choice : CARDINAL;
  224. 219 BEGIN
  225. 220 (*yes*)
  226. 221 IF BatchMode THEN
  227. 222 StringIO.WriteStr(StringIO.outp, 'yes');
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. 223 RETURN TRUE;
  234. 224 END;
  235. 225 choice := KbdInput.KeyHit( KbdInput.YorN );
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. ***** ^ not supported yet
  240. 226 IF KbdInput.CAPkey(choice) = ORD('Y') THEN
  241. ***** ^ not supported yet
  242. ***** ^ not supported yet
  243. ***** ^ not supported yet
  244. ***** ^ undeclared identifier
  245. ***** ^ not supported yet
  246. 227 StringIO.WriteStr(StringIO.outp, 'yes');
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. ***** ^ not supported yet
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. 228 RETURN TRUE;
  253. 229 ELSE
  254. 230 StringIO.WriteStr(StringIO.outp, 'no');
  255. ***** ^ not supported yet
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. 231 IF KbdInput.CAPkey(choice) = ORD('Q') THEN
  261. ***** ^ not supported yet
  262. ***** ^ not supported yet
  263. ***** ^ not supported yet
  264. ***** ^ undeclared identifier
  265. ***** ^ not supported yet
  266. 232 exiting := TRUE;
  267. 233 END;
  268. 234 RETURN FALSE;
  269. 235 END;
  270. 236 END yes;
  271. ***** ^ not supported yet
  272. 237
  273. 238 PROCEDURE IsDriveLetter( TheStr: ARRAY OF CHAR ): BOOLEAN;
  274. ***** ^ not supported yet
  275. 239 BEGIN
  276. 240 RETURN (M2Strings.Length(TheStr) = 1)
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. 241 AND ( (CAP(TheStr[0]) >= 'A') AND (CAP(TheStr[0]) <= 'Z'));
  281. ***** ^ undeclared identifier
  282. ***** ^ not supported yet
  283. ***** ^ not supported yet
  284. ***** ^ undeclared identifier
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. 242 END IsDriveLetter;
  288. ***** ^ not supported yet
  289. 243
  290. 244
  291. 245 PROCEDURE Punctuate( VAR TheStr: ARRAY OF CHAR );
  292. ***** ^ not supported yet
  293. 246 VAR
  294. 247 index, PlaceCount: CARDINAL;
  295. 248 BEGIN
  296. 249 index := M2Strings.Length( TheStr );
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. 250 IF index > 0 THEN
  301. 251 DEC( index );
  302. ***** ^ undeclared identifier
  303. ***** ^ not supported yet
  304. 252 PlaceCount := 2;
  305. 253 REPEAT
  306. 254 IF PlaceCount > 0 THEN
  307. 255 IF index > 0 THEN
  308. 256 DEC( index );
  309. ***** ^ undeclared identifier
  310. ***** ^ not supported yet
  311. 257 END;
  312. 258 DEC( PlaceCount );
  313. ***** ^ undeclared identifier
  314. ***** ^ not supported yet
  315. 259 ELSE
  316. 260 PlaceCount := 2;
  317. 261 M2Strings.Insert( ',', TheStr, index );
  318. ***** ^ not supported yet
  319. ***** ^ not supported yet
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. 262 DEC( index );
  323. ***** ^ undeclared identifier
  324. ***** ^ not supported yet
  325. 263 END;
  326. 264 UNTIL (index = 0) OR (NOT PosUtils.IsNumericChar(TheStr[index]));
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. ***** ^ not supported yet
  331. 265 END;
  332. 266 END Punctuate;
  333. ***** ^ not supported yet
  334. 267
  335. 268
  336. 269 PROCEDURE DifferentDrives( str1, str2: ARRAY OF CHAR ): BOOLEAN;
  337. ***** ^ not supported yet
  338. 270 VAR
  339. 271 DriveChar1, DriveChar2: CHAR;
  340. 272 BEGIN
  341. 273 IF IsDriveLetter(str1) OR (str1[1] = ':') THEN
  342. ***** ^ not supported yet
  343. ***** ^ not supported yet
  344. ***** ^ not supported yet
  345. ***** ^ not supported yet
  346. 274 DriveChar1 := CAP(str1[0]);
  347. ***** ^ undeclared identifier
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. 275 ELSE
  351. 276 DriveChar1 := CAP(Drectory.GetDefaultDrive());
  352. ***** ^ undeclared identifier
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. 277 END;
  357. 278 IF IsDriveLetter(str2) OR (str2[1] = ':') THEN
  358. ***** ^ not supported yet
  359. ***** ^ not supported yet
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. 279 DriveChar2 := CAP(str2[0]);
  363. ***** ^ undeclared identifier
  364. ***** ^ not supported yet
  365. ***** ^ not supported yet
  366. 280 ELSE
  367. 281 DriveChar2 := CAP(Drectory.GetDefaultDrive());
  368. ***** ^ undeclared identifier
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. 282 END;
  373. 283 RETURN DriveChar1 # DriveChar2;
  374. 284 END DifferentDrives;
  375. ***** ^ not supported yet
  376. 285
  377. 286
  378. 287 PROCEDURE MakeInfoStr( FileInfo: Drectory.FileInfoRec; VAR TheStr: ARRAY
  379. ***** ^ not supported yet
  380. 288 OF CHAR );
  381. ***** ^ not supported yet
  382. 289 VAR
  383. 290 dumstr: ARRAY [0..79] OF CHAR;
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. 291 BEGIN
  387. 292 StrEdit.AssignStr( FileInfo.name, TheStr );
  388. ***** ^ not supported yet
  389. ***** ^ not supported yet
  390. ***** ^ not supported yet
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. 293 WHILE M2Strings.Length(TheStr) < 12 DO
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. 294 StrEdit.Append( TheStr, ' ' );
  398. ***** ^ not supported yet
  399. ***** ^ not supported yet
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. 295 END;
  403. 296 IF Drectory.SubdirectoryFile IN FileInfo.attribute THEN
  404. ***** ^ not supported yet
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. 297 StrEdit.Append( TheStr, ' <DIR>' );
  409. ***** ^ not supported yet
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. ***** ^ not supported yet
  413. 298 ELSE
  414. 299 StrConv.LongIntegerToStr( FileInfo.size, 0, dumstr );
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. ***** ^ not supported yet
  419. ***** ^ not supported yet
  420. 300 IF FileInfo.size < 1000000 THEN
  421. ***** ^ not supported yet
  422. ***** ^ not supported yet
  423. 301 (* No room for commas if the string is longer than 6 chars. *)
  424. 302 Punctuate( dumstr );
  425. ***** ^ not supported yet
  426. ***** ^ not supported yet
  427. 303 END;
  428. 304 StrEdit.RightJustify( dumstr, 8 );
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. ***** ^ not supported yet
  432. ***** ^ not supported yet
  433. 305 StrEdit.Append( TheStr, dumstr );
  434. ***** ^ not supported yet
  435. ***** ^ not supported yet
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. 306 END;
  439. 307 StrConv.DateToStr( FileInfo.month, FileInfo.day, FileInfo.year,
  440. ***** ^ not supported yet
  441. ***** ^ not supported yet
  442. ***** ^ not supported yet
  443. ***** ^ not supported yet
  444. ***** ^ not supported yet
  445. ***** ^ not supported yet
  446. ***** ^ not supported yet
  447. ***** ^ not supported yet
  448. 308 dumstr );
  449. ***** ^ not supported yet
  450. 309 StrEdit.Append( TheStr, ' ' );
  451. ***** ^ not supported yet
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. ***** ^ not supported yet
  455. 310 StrEdit.Append( TheStr, dumstr );
  456. ***** ^ not supported yet
  457. ***** ^ not supported yet
  458. ***** ^ not supported yet
  459. ***** ^ not supported yet
  460. 311 StrConv.TimeToStr( FileInfo.hour, FileInfo.minute, FileInfo.second,
  461. ***** ^ not supported yet
  462. ***** ^ not supported yet
  463. ***** ^ not supported yet
  464. ***** ^ not supported yet
  465. ***** ^ not supported yet
  466. ***** ^ not supported yet
  467. ***** ^ not supported yet
  468. ***** ^ not supported yet
  469. 312 FileInfo.second, dumstr );
  470. ***** ^ not supported yet
  471. ***** ^ not supported yet
  472. ***** ^ not supported yet
  473. 313 M2Strings.Delete( dumstr, M2Strings.Length(dumstr) - 7, 6 );
  474. ***** ^ not supported yet
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. ***** ^ not supported yet
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. ***** ^ not supported yet
  481. 314 StrEdit.Append( TheStr, ' ' );
  482. ***** ^ not supported yet
  483. ***** ^ not supported yet
  484. ***** ^ not supported yet
  485. ***** ^ not supported yet
  486. 315 StrEdit.Append( TheStr, dumstr );
  487. ***** ^ not supported yet
  488. ***** ^ not supported yet
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. 316 END MakeInfoStr;
  492. ***** ^ not supported yet
  493. 317
  494. 318 PROCEDURE SayNotFound();
  495. 319 VAR
  496. 320 BytesFree : LONGINT;
  497. 321 label, BytesFreeStr : ARRAY [0..79] OF CHAR;
  498. ***** ^ not supported yet
  499. ***** ^ not supported yet
  500. 322 BEGIN
  501. 323 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. ***** ^ not supported yet
  505. ***** ^ not supported yet
  506. 324 Drectory.FreeDiskSpace(TheDrive,BytesFree) );
  507. ***** ^ not supported yet
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. 325 StrConv.LongIntegerToStr(BytesFree, 1, BytesFreeStr);
  511. ***** ^ not supported yet
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. 326 Punctuate( BytesFreeStr );
  515. ***** ^ not supported yet
  516. ***** ^ not supported yet
  517. 327 Drectory.VolumeLabel(TheDrive, label);
  518. ***** ^ not supported yet
  519. ***** ^ not supported yet
  520. ***** ^ not supported yet
  521. 328 StringIO.WriteStr(StringIO.outp, 'File not found on ');
  522. ***** ^ not supported yet
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. ***** ^ not supported yet
  526. ***** ^ not supported yet
  527. 329 StringIO.WriteStr(StringIO.outp, label);
  528. ***** ^ not supported yet
  529. ***** ^ not supported yet
  530. ***** ^ not supported yet
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. 330 StringIO.WriteStr(StringIO.outp, '; ');
  534. ***** ^ not supported yet
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. ***** ^ not supported yet
  539. 331 StringIO.WriteStr(StringIO.outp, BytesFreeStr);
  540. ***** ^ not supported yet
  541. ***** ^ not supported yet
  542. ***** ^ not supported yet
  543. ***** ^ not supported yet
  544. ***** ^ not supported yet
  545. 332 StringIO.WriteEol(StringIO.outp, ' bytes free.');
  546. ***** ^ not supported yet
  547. ***** ^ not supported yet
  548. ***** ^ not supported yet
  549. ***** ^ not supported yet
  550. ***** ^ not supported yet
  551. 333 END SayNotFound;
  552. ***** ^ not supported yet
  553. 334
  554. 335 PROCEDURE WriteBarAndPrompt( FileInfoStr, ActionProposed,
  555. 336 NewName: ARRAY OF CHAR );
  556. ***** ^ not supported yet
  557. 337 VAR
  558. 338 tmpstr: ARRAY [0..79] OF CHAR;
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. 339 BEGIN
  562. 340 StrEdit.AssignStr( FileInfoStr, tmpstr );
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. ***** ^ not supported yet
  566. ***** ^ not supported yet
  567. 341 StrEdit.Append( tmpstr, blank );
  568. ***** ^ not supported yet
  569. ***** ^ not supported yet
  570. ***** ^ not supported yet
  571. ***** ^ not supported yet
  572. 342 StrEdit.Append( tmpstr, CHR(186) );
  573. ***** ^ not supported yet
  574. ***** ^ not supported yet
  575. ***** ^ not supported yet
  576. ***** ^ undeclared identifier
  577. ***** ^ not supported yet
  578. 343 StrEdit.Append( tmpstr, blank );
  579. ***** ^ not supported yet
  580. ***** ^ not supported yet
  581. ***** ^ not supported yet
  582. ***** ^ not supported yet
  583. 344 StrEdit.Append( tmpstr, ActionProposed );
  584. ***** ^ not supported yet
  585. ***** ^ not supported yet
  586. ***** ^ not supported yet
  587. ***** ^ not supported yet
  588. 345 IF M2Strings.Length(NewName) > 0 THEN
  589. ***** ^ not supported yet
  590. ***** ^ not supported yet
  591. ***** ^ not supported yet
  592. 346 StrEdit.Append( tmpstr, blank );
  593. ***** ^ not supported yet
  594. ***** ^ not supported yet
  595. ***** ^ not supported yet
  596. ***** ^ not supported yet
  597. 347 StrEdit.Append( tmpstr, NewName );
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. ***** ^ not supported yet
  602. 348 END;
  603. 349 StrEdit.Append( tmpstr, '? ' );
  604. ***** ^ not supported yet
  605. ***** ^ not supported yet
  606. ***** ^ not supported yet
  607. ***** ^ not supported yet
  608. 350 StringIO.WriteStr( StringIO.outp, tmpstr );
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. ***** ^ not supported yet
  612. ***** ^ not supported yet
  613. ***** ^ not supported yet
  614. 351 END WriteBarAndPrompt;
  615. ***** ^ not supported yet
  616. 352
  617. 353 PROCEDURE ExpandAsterisk(VAR TheMask : ARRAY OF CHAR);
  618. ***** ^ not supported yet
  619. 354 VAR
  620. 355 base, spot, indx : CARDINAL;
  621. 356
  622. 357 BEGIN
  623. 358 (*ExpandAsterisk*)
  624. 359 indx := M2Strings.Pos('*',TheMask);
  625. ***** ^ not supported yet
  626. ***** ^ not supported yet
  627. ***** ^ not supported yet
  628. 360 WHILE indx<=HIGH(TheMask) DO
  629. ***** ^ undeclared identifier
  630. ***** ^ not supported yet
  631. 361 TheMask[indx] := '?';
  632. ***** ^ not supported yet
  633. ***** ^ not supported yet
  634. 362 base := indx;
  635. 363 WHILE (base > 0)
  636. 364 AND NOT (M2Strings.Pos( TheMask[base-1], ':\/' ) <= 2) DO
  637. ***** ^ not supported yet
  638. ***** ^ not supported yet
  639. ***** ^ not supported yet
  640. ***** ^ not supported yet
  641. ***** ^ not supported yet
  642. 365 DEC(base);
  643. ***** ^ undeclared identifier
  644. ***** ^ not supported yet
  645. 366 END;
  646. 367 spot := PosUtils.Positn( '.', TheMask, base );
  647. ***** ^ not supported yet
  648. ***** ^ not supported yet
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. 368 IF (spot>HIGH(TheMask)) THEN
  652. ***** ^ undeclared identifier
  653. ***** ^ not supported yet
  654. 369 (*There's no period.*)
  655. 370 StrEdit.InsertTimes('?', TheMask, indx, 12 - (M2Strings.Length(TheMask) - base) );
  656. ***** ^ not supported yet
  657. ***** ^ not supported yet
  658. ***** ^ not supported yet
  659. ***** ^ not supported yet
  660. ***** ^ not supported yet
  661. ***** ^ not supported yet
  662. ***** ^ not supported yet
  663. 371 TheMask[ base + 8 ] := '.';
  664. ***** ^ not supported yet
  665. ***** ^ not supported yet
  666. 372 ELSIF (spot>indx) THEN
  667. 373 (*Asterisk was in the filename part, not extension part.*)
  668. 374 StrEdit.InsertTimes('?', TheMask, indx, 8 - (spot - base) );
  669. ***** ^ not supported yet
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. ***** ^ not supported yet
  673. 375 ELSE
  674. 376 (*Asterisk was in the extension part.*)
  675. 377 StrEdit.InsertTimes('?', TheMask, indx, 4 - (M2Strings.Length(TheMask) - spot) );
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. ***** ^ not supported yet
  682. ***** ^ not supported yet
  683. 378 END;
  684. 379 indx := M2Strings.Pos('*',TheMask);
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. ***** ^ not supported yet
  688. 380 END;
  689. 381 END ExpandAsterisk;
  690. ***** ^ not supported yet
  691. 382
  692. 383 PROCEDURE PrepareDirMask(VAR TheStr : ARRAY OF CHAR);
  693. ***** ^ not supported yet
  694. 384 VAR
  695. 385 spot : CARDINAL;
  696. 386 BEGIN
  697. 387 TheDrive := 'z';
  698. 388 (*for default*)
  699. 389 deleting := FALSE;
  700. 390 copying := FALSE;
  701. 391 renaming := FALSE;
  702. 392 moving := FALSE;
  703. 393 StrEdit.CrunchBlanks(TheStr);
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. ***** ^ not supported yet
  707. 394 IF (M2Strings.Length(TheStr)>=2) THEN
  708. ***** ^ not supported yet
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. 395 IF TheStr[M2Strings.Length(TheStr)-2]='/' THEN
  712. ***** ^ not supported yet
  713. ***** ^ not supported yet
  714. ***** ^ not supported yet
  715. ***** ^ not supported yet
  716. ***** ^ not supported yet
  717. 396 IF CAP( TheStr[M2Strings.Length(TheStr)-1] ) = 'B' THEN
  718. ***** ^ undeclared identifier
  719. ***** ^ not supported yet
  720. ***** ^ not supported yet
  721. ***** ^ not supported yet
  722. ***** ^ not supported yet
  723. ***** ^ not supported yet
  724. 397 M2Strings.Delete(TheStr, M2Strings.Length(TheStr)-2, 2);
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. ***** ^ not supported yet
  728. ***** ^ not supported yet
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. ***** ^ not supported yet
  732. 398 StrEdit.CutTrailingChars(blank, TheStr);
  733. ***** ^ not supported yet
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. 399 BatchMode := TRUE;
  737. 400 ELSE
  738. 401 BatchMode := FALSE;
  739. 402 END;
  740. 403 deleting := CAP( TheStr[M2Strings.Length(TheStr)-1] ) = 'E';
  741. ***** ^ undeclared identifier
  742. ***** ^ not supported yet
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. ***** ^ not supported yet
  747. 404 copying := CAP( TheStr[M2Strings.Length(TheStr)-1] ) = 'C';
  748. ***** ^ undeclared identifier
  749. ***** ^ not supported yet
  750. ***** ^ not supported yet
  751. ***** ^ not supported yet
  752. ***** ^ not supported yet
  753. ***** ^ not supported yet
  754. 405 renaming := CAP( TheStr[M2Strings.Length(TheStr)-1] ) = 'R';
  755. ***** ^ undeclared identifier
  756. ***** ^ not supported yet
  757. ***** ^ not supported yet
  758. ***** ^ not supported yet
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. 406 moving := CAP( TheStr[M2Strings.Length(TheStr)-1] ) = 'M';
  762. ***** ^ undeclared identifier
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. ***** ^ not supported yet
  766. ***** ^ not supported yet
  767. ***** ^ not supported yet
  768. 407 M2Strings.Delete(TheStr, M2Strings.Length(TheStr)-2, 2);
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. ***** ^ not supported yet
  775. ***** ^ not supported yet
  776. 408 StrEdit.CutTrailingChars(blank, TheStr);
  777. ***** ^ not supported yet
  778. ***** ^ not supported yet
  779. ***** ^ not supported yet
  780. 409 END;
  781. 410 END;
  782. 411 spot := M2Strings.Pos(blank,TheStr);
  783. ***** ^ not supported yet
  784. ***** ^ not supported yet
  785. ***** ^ not supported yet
  786. 412 IF spot<=HIGH(TheStr) THEN
  787. ***** ^ undeclared identifier
  788. ***** ^ not supported yet
  789. 413 M2Strings.Copy(TheStr, spot+1, M2Strings.Length(TheStr)-1-spot, SecondStr);
  790. ***** ^ not supported yet
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. ***** ^ not supported yet
  796. ***** ^ not supported yet
  797. 414 M2Strings.Delete(TheStr, spot, M2Strings.Length(SecondStr)+1);
  798. ***** ^ not supported yet
  799. ***** ^ not supported yet
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. ***** ^ not supported yet
  804. ***** ^ not supported yet
  805. 415 ELSE
  806. 416 SecondStr := null;
  807. ***** ^ not supported yet
  808. ***** ^ incompatible assignment
  809. 417 END;
  810. 418 IF M2Strings.Length(TheStr) = 0 THEN
  811. ***** ^ not supported yet
  812. ***** ^ not supported yet
  813. ***** ^ not supported yet
  814. 419 StrEdit.AssignStr( '*.*',TheStr);
  815. ***** ^ not supported yet
  816. ***** ^ not supported yet
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. 420 ExpandAsterisk( TheStr );
  820. ***** ^ not supported yet
  821. ***** ^ not supported yet
  822. 421 RETURN;
  823. 422 END;
  824. 423 IF M2Strings.Pos( '..', TheStr ) = ( HIGH(TheStr) - 1 ) THEN
  825. ***** ^ not supported yet
  826. ***** ^ not supported yet
  827. ***** ^ not supported yet
  828. ***** ^ not supported yet
  829. ***** ^ undeclared identifier
  830. ***** ^ not supported yet
  831. 424 StrEdit.Append(TheStr, '\*.*');
  832. ***** ^ not supported yet
  833. ***** ^ not supported yet
  834. ***** ^ not supported yet
  835. ***** ^ not supported yet
  836. 425 END;
  837. 426 IF ((TheStr[M2Strings.Length(TheStr)-1]='\') OR
  838. ***** ^ not supported yet
  839. ***** ^ not supported yet
  840. ***** ^ not supported yet
  841. ***** ^ not supported yet
  842. ***** ^ not supported yet
  843. 427 (TheStr[M2Strings.Length(TheStr)-1]='/')) THEN
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ not supported yet
  847. ***** ^ not supported yet
  848. ***** ^ not supported yet
  849. 428 StrEdit.Append(TheStr, '*.*');
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. ***** ^ not supported yet
  853. ***** ^ not supported yet
  854. 429 ELSIF IsDriveLetter(TheStr) THEN
  855. ***** ^ not supported yet
  856. ***** ^ not supported yet
  857. 430 StrEdit.Append(TheStr, ':*.*');
  858. ***** ^ not supported yet
  859. ***** ^ not supported yet
  860. ***** ^ not supported yet
  861. ***** ^ not supported yet
  862. 431 END;
  863. 432 IF TheStr[1]=':' THEN
  864. ***** ^ not supported yet
  865. ***** ^ not supported yet
  866. 433 TheDrive := TheStr[0];
  867. ***** ^ not supported yet
  868. ***** ^ not supported yet
  869. 434 IF M2Strings.Length(TheStr)=2 THEN
  870. ***** ^ not supported yet
  871. ***** ^ not supported yet
  872. ***** ^ not supported yet
  873. 435 StrEdit.Append(TheStr, '*.*');
  874. ***** ^ not supported yet
  875. ***** ^ not supported yet
  876. ***** ^ not supported yet
  877. ***** ^ not supported yet
  878. 436 END;
  879. 437 END;
  880. 438 ExpandAsterisk( TheStr );
  881. ***** ^ not supported yet
  882. ***** ^ not supported yet
  883. 439 END PrepareDirMask;
  884. ***** ^ not supported yet
  885. 440
  886. 441 PROCEDURE SplitPathName(VAR PathName, TheMask : ARRAY OF CHAR);
  887. ***** ^ not supported yet
  888. 442 VAR
  889. 443 TmpStr : ARRAY [0..79] OF CHAR;
  890. ***** ^ not supported yet
  891. ***** ^ not supported yet
  892. 444 spot : CARDINAL;
  893. 445 BEGIN
  894. 446 (*SplitPathName*)
  895. 447 IF IsDriveLetter(TheMask) THEN
  896. ***** ^ not supported yet
  897. ***** ^ not supported yet
  898. 448 StrEdit.AssignStr( TheMask, PathName );
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. ***** ^ not supported yet
  902. ***** ^ not supported yet
  903. 449 StrEdit.Append( PathName, ':' );
  904. ***** ^ not supported yet
  905. ***** ^ not supported yet
  906. ***** ^ not supported yet
  907. ***** ^ not supported yet
  908. 450 StrEdit.AssignStr( null, TheMask );
  909. ***** ^ not supported yet
  910. ***** ^ not supported yet
  911. ***** ^ not supported yet
  912. 451 RETURN;
  913. 452 END;
  914. 453 StrEdit.AssignStr( null, PathName);
  915. ***** ^ not supported yet
  916. ***** ^ not supported yet
  917. ***** ^ not supported yet
  918. 454 spot := 0;
  919. 455 WHILE spot+1<=M2Strings.Length(TheMask) DO
  920. ***** ^ not supported yet
  921. ***** ^ not supported yet
  922. ***** ^ not supported yet
  923. 456 IF ((TheMask[spot]='\') OR (TheMask[spot]='/'
  924. ***** ^ not supported yet
  925. ***** ^ not supported yet
  926. ***** ^ not supported yet
  927. ***** ^ not supported yet
  928. 457 ) OR (TheMask[spot]=':')) THEN
  929. ***** ^ not supported yet
  930. ***** ^ not supported yet
  931. 458 M2Strings.Copy(TheMask, 0, spot+1, TmpStr);
  932. ***** ^ not supported yet
  933. ***** ^ not supported yet
  934. ***** ^ not supported yet
  935. ***** ^ not supported yet
  936. 459 StrEdit.Append(PathName, TmpStr);
  937. ***** ^ not supported yet
  938. ***** ^ not supported yet
  939. ***** ^ not supported yet
  940. ***** ^ not supported yet
  941. 460 M2Strings.Delete(TheMask, 0, 1+spot);
  942. ***** ^ not supported yet
  943. ***** ^ not supported yet
  944. ***** ^ not supported yet
  945. ***** ^ not supported yet
  946. 461 spot := 0;
  947. 462 ELSE
  948. 463 INC(spot);
  949. ***** ^ undeclared identifier
  950. ***** ^ not supported yet
  951. 464 END;
  952. 465 END;
  953. 466 END SplitPathName;
  954. ***** ^ not supported yet
  955. 467
  956. 468 PROCEDURE EraseOneFile( PathName, FileName: ARRAY OF CHAR ): BOOLEAN;
  957. ***** ^ not supported yet
  958. 469 VAR
  959. 470 Fname : ARRAY [0..79] OF CHAR;
  960. ***** ^ not supported yet
  961. ***** ^ not supported yet
  962. 471 BEGIN
  963. 472 StrEdit.AssignStr( FileName, Fname );
  964. ***** ^ not supported yet
  965. ***** ^ not supported yet
  966. ***** ^ not supported yet
  967. ***** ^ not supported yet
  968. 473 M2Strings.Insert(PathName, Fname, 0);
  969. ***** ^ not supported yet
  970. ***** ^ not supported yet
  971. ***** ^ not supported yet
  972. ***** ^ not supported yet
  973. ***** ^ not supported yet
  974. 474 IF Drectory.DeleteFile(Fname) = StringIO.NoError THEN
  975. ***** ^ not supported yet
  976. ***** ^ not supported yet
  977. ***** ^ not supported yet
  978. ***** ^ not supported yet
  979. ***** ^ not supported yet
  980. 475 RETURN TRUE;
  981. 476 ELSE
  982. 477 RETURN FALSE;
  983. 478 END;
  984. 479 END EraseOneFile;
  985. ***** ^ not supported yet
  986. 480
  987. 481 PROCEDURE EraseFiles();
  988. 482 VAR
  989. 483 PathName, Fname, TmpStr : ARRAY [0..79] OF CHAR;
  990. ***** ^ not supported yet
  991. ***** ^ not supported yet
  992. 484 DirHandle: CARDINAL;
  993. 485 BEGIN
  994. 486 (*EraseFiles*)
  995. 487 DirHandle := 0FFFFH;
  996. 488 SavedMessage := Drectory.FindFirstFile( DirMask, DirHandle, FileInfo );
  997. ***** ^ not supported yet
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. ***** ^ not supported yet
  1001. 489 IF SavedMessage # StringIO.NoError THEN
  1002. ***** ^ not supported yet
  1003. ***** ^ not supported yet
  1004. 490 SayNotFound();
  1005. ***** ^ not supported yet
  1006. ***** ^ not supported yet
  1007. 491 RETURN;
  1008. 492 END;
  1009. 493 SplitPathName(PathName, DirMask);
  1010. ***** ^ not supported yet
  1011. ***** ^ not supported yet
  1012. ***** ^ not supported yet
  1013. 494 REPEAT
  1014. 495 MakeInfoStr( FileInfo, TmpStr );
  1015. ***** ^ not supported yet
  1016. ***** ^ not supported yet
  1017. ***** ^ not supported yet
  1018. 496 IF NOT (Drectory.SubdirectoryFile IN FileInfo.attribute) THEN
  1019. ***** ^ not supported yet
  1020. ***** ^ not supported yet
  1021. ***** ^ not supported yet
  1022. ***** ^ not supported yet
  1023. 497 WriteBarAndPrompt( TmpStr, 'Erase', '' );
  1024. ***** ^ not supported yet
  1025. ***** ^ not supported yet
  1026. ***** ^ not supported yet
  1027. ***** ^ not supported yet
  1028. 498 IF yes() THEN
  1029. ***** ^ not supported yet
  1030. ***** ^ not supported yet
  1031. 499 IF NOT EraseOneFile( PathName, FileInfo.name ) THEN
  1032. ***** ^ not supported yet
  1033. ***** ^ not supported yet
  1034. ***** ^ not supported yet
  1035. ***** ^ not supported yet
  1036. 500 END;
  1037. 501 END;
  1038. 502 StringIO.WriteEol(StringIO.outp, null);
  1039. ***** ^ not supported yet
  1040. ***** ^ not supported yet
  1041. ***** ^ not supported yet
  1042. ***** ^ not supported yet
  1043. ***** ^ not supported yet
  1044. 503 END;
  1045. 504 SavedMessage := Drectory.FindNextFile( DirHandle, FileInfo );
  1046. ***** ^ not supported yet
  1047. ***** ^ not supported yet
  1048. ***** ^ not supported yet
  1049. 505 UNTIL (SavedMessage#StringIO.NoError) OR exiting;
  1050. ***** ^ not supported yet
  1051. ***** ^ not supported yet
  1052. 506 IF 0 # FAPI.DOSFINDCLOSE( DirHandle ) THEN END;
  1053. ***** ^ not supported yet
  1054. ***** ^ not supported yet
  1055. ***** ^ not supported yet
  1056. 507 END EraseFiles;
  1057. ***** ^ not supported yet
  1058. 508
  1059. 509
  1060. 510 PROCEDURE CopyFiles();
  1061. 511 VAR
  1062. 512 PathName1, PathName2 : ARRAY [0..79] OF CHAR;
  1063. ***** ^ not supported yet
  1064. ***** ^ not supported yet
  1065. 513 OldHandle, DirHandle : CARDINAL;
  1066. 514 OldHandleOpen : BOOLEAN;
  1067. 515 SavedMessage : CARDINAL;
  1068. 516 SavedFileMode : BITSET;
  1069. ***** ^ undeclared identifier
  1070. 517 TmpStr1, NewFullName, OldFullName : ARRAY [0..79] OF CHAR;
  1071. ***** ^ not supported yet
  1072. ***** ^ not supported yet
  1073. 518
  1074. 519 PROCEDURE CheckDest( VAR PathName, FileName: ARRAY OF CHAR ): BOOLEAN;
  1075. ***** ^ not supported yet
  1076. 520 VAR
  1077. 521 TmpStr, NewFileName: ARRAY [0..79] OF CHAR;
  1078. ***** ^ not supported yet
  1079. ***** ^ not supported yet
  1080. 522 FinishedChecking : BOOLEAN;
  1081. 523 TmpFileInfo: Drectory.FileInfoRec;
  1082. ***** ^ not supported yet
  1083. 524 DirHandle: CARDINAL;
  1084. 525 BEGIN
  1085. 526 DirHandle := 0FFFFH;
  1086. 527 REPEAT
  1087. 528 FinishedChecking := TRUE;
  1088. 529 M2Strings.Concat(PathName, FileName, NewFileName);
  1089. ***** ^ not supported yet
  1090. ***** ^ not supported yet
  1091. ***** ^ not supported yet
  1092. ***** ^ not supported yet
  1093. ***** ^ not supported yet
  1094. 530 SavedMessage := Drectory.FindFirstFile(NewFileName, DirHandle,
  1095. ***** ^ not supported yet
  1096. ***** ^ not supported yet
  1097. ***** ^ not supported yet
  1098. 531 TmpFileInfo);
  1099. ***** ^ not supported yet
  1100. 532 IF NOT ((SavedMessage = StringIO.FileNotFound) OR (SavedMessage=
  1101. ***** ^ not supported yet
  1102. ***** ^ not supported yet
  1103. 533 StringIO.NoMoreFiles)) THEN
  1104. ***** ^ not supported yet
  1105. ***** ^ not supported yet
  1106. 534 IF SavedMessage # StringIO.NoError THEN
  1107. ***** ^ not supported yet
  1108. ***** ^ not supported yet
  1109. 535 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1110. ***** ^ not supported yet
  1111. ***** ^ not supported yet
  1112. ***** ^ not supported yet
  1113. ***** ^ not supported yet
  1114. 536 SavedMessage );
  1115. ***** ^ not supported yet
  1116. 537 ELSE
  1117. 538 MakeInfoStr( TmpFileInfo, TmpStr );
  1118. ***** ^ not supported yet
  1119. ***** ^ not supported yet
  1120. ***** ^ not supported yet
  1121. 539 StringIO.WriteEol(StringIO.outp, null);
  1122. ***** ^ not supported yet
  1123. ***** ^ not supported yet
  1124. ***** ^ not supported yet
  1125. ***** ^ not supported yet
  1126. ***** ^ not supported yet
  1127. 540 WriteBarAndPrompt( TmpStr, 'Destroy', '' );
  1128. ***** ^ not supported yet
  1129. ***** ^ not supported yet
  1130. ***** ^ not supported yet
  1131. ***** ^ not supported yet
  1132. 541 IF NOT yes() THEN
  1133. ***** ^ not supported yet
  1134. ***** ^ not supported yet
  1135. 542 StringIO.WriteEol(StringIO.outp, null);
  1136. ***** ^ not supported yet
  1137. ***** ^ not supported yet
  1138. ***** ^ not supported yet
  1139. ***** ^ not supported yet
  1140. ***** ^ not supported yet
  1141. 543 StringIO.WriteStr(StringIO.outp,
  1142. ***** ^ not supported yet
  1143. ***** ^ not supported yet
  1144. ***** ^ not supported yet
  1145. ***** ^ not supported yet
  1146. 544 'Enter new name, or <RETURN> to skip: ');
  1147. ***** ^ not supported yet
  1148. 545 StringIO.ReadStr(StringIO.inp, FileName);
  1149. ***** ^ not supported yet
  1150. ***** ^ not supported yet
  1151. ***** ^ not supported yet
  1152. ***** ^ not supported yet
  1153. ***** ^ not supported yet
  1154. 546 IF M2Strings.Length(FileName)=0 THEN
  1155. ***** ^ not supported yet
  1156. ***** ^ not supported yet
  1157. ***** ^ not supported yet
  1158. 547 IF 0 # FAPI.DOSFINDCLOSE( DirHandle ) THEN END;
  1159. ***** ^ not supported yet
  1160. ***** ^ not supported yet
  1161. ***** ^ not supported yet
  1162. 548 RETURN FALSE;
  1163. 549 ELSE
  1164. 550 SplitPathName( PathName, FileName );
  1165. ***** ^ not supported yet
  1166. ***** ^ not supported yet
  1167. ***** ^ not supported yet
  1168. 551 FinishedChecking := FALSE;
  1169. 552 END;
  1170. 553 END;
  1171. 554 END;
  1172. 555 END;
  1173. 556 UNTIL FinishedChecking OR exiting;
  1174. 557 IF 0 # FAPI.DOSFINDCLOSE( DirHandle ) THEN END;
  1175. ***** ^ not supported yet
  1176. ***** ^ not supported yet
  1177. ***** ^ not supported yet
  1178. 558 RETURN TRUE;
  1179. 559 END CheckDest;
  1180. ***** ^ not supported yet
  1181. 560
  1182. 561 BEGIN
  1183. 562 (*CopyFiles*)
  1184. 563 DirHandle := 0FFFFH;
  1185. 564 IF Drectory.FindFirstFile( DirMask, DirHandle, FileInfo )
  1186. ***** ^ not supported yet
  1187. ***** ^ not supported yet
  1188. ***** ^ not supported yet
  1189. ***** ^ not supported yet
  1190. 565 # StringIO.NoError THEN
  1191. ***** ^ not supported yet
  1192. ***** ^ not supported yet
  1193. 566 SayNotFound();
  1194. ***** ^ not supported yet
  1195. ***** ^ not supported yet
  1196. 567 RETURN;
  1197. 568 END;
  1198. 569 IF M2Strings.Length(SecondStr)=0 THEN
  1199. ***** ^ not supported yet
  1200. ***** ^ not supported yet
  1201. ***** ^ not supported yet
  1202. 570 StringIO.WriteStr(StringIO.outp, ' Copy to what drive:\path? ');
  1203. ***** ^ not supported yet
  1204. ***** ^ not supported yet
  1205. ***** ^ not supported yet
  1206. ***** ^ not supported yet
  1207. ***** ^ not supported yet
  1208. 571 StringIO.ReadStr(StringIO.inp, SecondStr );
  1209. ***** ^ not supported yet
  1210. ***** ^ not supported yet
  1211. ***** ^ not supported yet
  1212. ***** ^ not supported yet
  1213. ***** ^ not supported yet
  1214. 572 END;
  1215. 573 SplitPathName( PathName2, SecondStr );
  1216. ***** ^ not supported yet
  1217. ***** ^ not supported yet
  1218. ***** ^ not supported yet
  1219. 574 SplitPathName( PathName1, DirMask );
  1220. ***** ^ not supported yet
  1221. ***** ^ not supported yet
  1222. ***** ^ not supported yet
  1223. 575 REPEAT
  1224. 576 MakeInfoStr( FileInfo, TmpStr1 );
  1225. ***** ^ not supported yet
  1226. ***** ^ not supported yet
  1227. ***** ^ not supported yet
  1228. 577 IF NOT (Drectory.SubdirectoryFile IN FileInfo.attribute) THEN
  1229. ***** ^ not supported yet
  1230. ***** ^ not supported yet
  1231. ***** ^ not supported yet
  1232. ***** ^ not supported yet
  1233. 578 WriteBarAndPrompt( TmpStr1, 'Copy', '' );
  1234. ***** ^ not supported yet
  1235. ***** ^ not supported yet
  1236. ***** ^ not supported yet
  1237. ***** ^ not supported yet
  1238. 579 IF yes() THEN
  1239. ***** ^ not supported yet
  1240. ***** ^ not supported yet
  1241. 580 M2Strings.Concat(PathName1, FileInfo.name, OldFullName);
  1242. ***** ^ not supported yet
  1243. ***** ^ not supported yet
  1244. ***** ^ not supported yet
  1245. ***** ^ not supported yet
  1246. ***** ^ not supported yet
  1247. ***** ^ not supported yet
  1248. 581
  1249. 582 SavedFileMode := HandleIO.DefaultFileMode;
  1250. ***** ^ not supported yet
  1251. ***** ^ not supported yet
  1252. ***** ^ not supported yet
  1253. 583 HandleIO.DefaultFileMode := BITSET{ 5 };
  1254. ***** ^ not supported yet
  1255. ***** ^ not supported yet
  1256. ***** ^ undeclared identifier
  1257. ***** ^ not supported yet
  1258. 584 (* Read-only access; deny no other access *)
  1259. 585 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1260. ***** ^ not supported yet
  1261. ***** ^ not supported yet
  1262. ***** ^ not supported yet
  1263. ***** ^ not supported yet
  1264. 586 HandleIO.OpenFile(OldHandle, OldFullName) );
  1265. ***** ^ not supported yet
  1266. ***** ^ not supported yet
  1267. ***** ^ not supported yet
  1268. 587 OldHandleOpen := TRUE;
  1269. 588 HandleIO.DefaultFileMode := SavedFileMode;
  1270. ***** ^ not supported yet
  1271. ***** ^ not supported yet
  1272. ***** ^ not supported yet
  1273. 589
  1274. 590 IF M2Strings.Length(SecondStr) = 0 THEN
  1275. ***** ^ not supported yet
  1276. ***** ^ not supported yet
  1277. ***** ^ not supported yet
  1278. 591 StrEdit.AssignStr( FileInfo.name, TmpStr1 );
  1279. ***** ^ not supported yet
  1280. ***** ^ not supported yet
  1281. ***** ^ not supported yet
  1282. ***** ^ not supported yet
  1283. ***** ^ not supported yet
  1284. 592 ELSE
  1285. 593 StrEdit.AssignStr( SecondStr, TmpStr1 );
  1286. ***** ^ not supported yet
  1287. ***** ^ not supported yet
  1288. ***** ^ not supported yet
  1289. ***** ^ not supported yet
  1290. 594 END;
  1291. 595 IF CheckDest( PathName2, TmpStr1 ) THEN
  1292. ***** ^ not supported yet
  1293. ***** ^ not supported yet
  1294. ***** ^ not supported yet
  1295. 596 M2Strings.Concat(PathName2, TmpStr1, NewFullName);
  1296. ***** ^ not supported yet
  1297. ***** ^ not supported yet
  1298. ***** ^ not supported yet
  1299. ***** ^ not supported yet
  1300. ***** ^ not supported yet
  1301. 597 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1302. ***** ^ not supported yet
  1303. ***** ^ not supported yet
  1304. ***** ^ not supported yet
  1305. ***** ^ not supported yet
  1306. 598 Drectory.CopyFile(OldHandle, NewFullName));
  1307. ***** ^ not supported yet
  1308. ***** ^ not supported yet
  1309. ***** ^ not supported yet
  1310. 599 IF moving THEN
  1311. 600 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1312. ***** ^ not supported yet
  1313. ***** ^ not supported yet
  1314. ***** ^ not supported yet
  1315. ***** ^ not supported yet
  1316. 601 HandleIO.CloseHandle(OldHandle));
  1317. ***** ^ not supported yet
  1318. ***** ^ not supported yet
  1319. ***** ^ not supported yet
  1320. 602 OldHandleOpen := FALSE;
  1321. 603 IF NOT EraseOneFile( PathName1, FileInfo.name ) THEN
  1322. ***** ^ not supported yet
  1323. ***** ^ not supported yet
  1324. ***** ^ not supported yet
  1325. ***** ^ not supported yet
  1326. 604 HALT;
  1327. ***** ^ undeclared identifier
  1328. 605 END;
  1329. 606 END;
  1330. 607 END;
  1331. 608 IF OldHandleOpen THEN
  1332. 609 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1333. ***** ^ not supported yet
  1334. ***** ^ not supported yet
  1335. ***** ^ not supported yet
  1336. ***** ^ not supported yet
  1337. 610 HandleIO.CloseHandle(OldHandle));
  1338. ***** ^ not supported yet
  1339. ***** ^ not supported yet
  1340. ***** ^ not supported yet
  1341. 611 OldHandleOpen := FALSE;
  1342. 612 END;
  1343. 613 END;
  1344. ***** ^ ident expected
  1345. 614 StringIO.WriteEol(StringIO.outp, null);
  1346. 615 END;
  1347. 616 SavedMessage := Drectory.FindNextFile( DirHandle, FileInfo );
  1348. 617 UNTIL (SavedMessage # StringIO.NoError) OR exiting;
  1349. 618 IF 0 # FAPI.DOSFINDCLOSE( DirHandle ) THEN END;
  1350. 619 END CopyFiles;
  1351. 620
  1352. 621
  1353. 622 PROCEDURE RenameFiles();
  1354. 623 VAR
  1355. 624 mask2, path2, path1 : ARRAY [0..79] OF CHAR;
  1356. 625
  1357. 626 PROCEDURE GetNewName(VAR InfoStr, OldName, NewName : ARRAY OF CHAR);
  1358. 627 VAR
  1359. 628 TmpOld : ARRAY [0..79] OF CHAR;
  1360. 629 ndx : CARDINAL;
  1361. 630 BEGIN
  1362. 631 (*GetNewName*)
  1363. 632 StrEdit.AssignStr( null, NewName);
  1364. 633 M2Strings.Copy(InfoStr, 0, M2Strings.Pos(blank,InfoStr), OldName);
  1365. 634 StrEdit.AssignStr( OldName, TmpOld);
  1366. 635 ndx := M2Strings.Pos('.',TmpOld);
  1367. 636 IF ndx>HIGH(TmpOld) THEN
  1368. 637 StrEdit.Append(TmpOld, '*');
  1369. 638 ExpandAsterisk(TmpOld);
  1370. 639 ELSIF (ndx<8) THEN
  1371. 640 M2Strings.Insert('*', TmpOld, ndx);
  1372. 641 ExpandAsterisk(TmpOld);
  1373. 642 END;
  1374. 643 ndx := 0;
  1375. 644 REPEAT
  1376. 645 IF mask2[ndx]='?' THEN
  1377. 646 IF TmpOld[ndx]#'?' THEN
  1378. 647 StrEdit.Append(NewName, TmpOld[ndx]);
  1379. 648 END;
  1380. 649 ELSE
  1381. 650 StrEdit.Append(NewName, mask2[ndx]);
  1382. 651 END;
  1383. 652 INC(ndx);
  1384. 653 UNTIL (ndx>=M2Strings.Length(mask2));
  1385. 654 END GetNewName;
  1386. 655
  1387. 656 VAR
  1388. 657 TmpStr1, TmpStr2, OldName, InfoStr, NewName : ARRAY [0..79] OF CHAR;
  1389. 658 DirHandle: CARDINAL;
  1390. 659 BEGIN
  1391. 660 (*RenameFiles*)
  1392. 661 DirHandle := 0FFFFH;
  1393. 662 IF Drectory.FindFirstFile(DirMask, DirHandle, FileInfo)
  1394. 663 # StringIO.NoError THEN
  1395. 664 SayNotFound();
  1396. 665 RETURN;
  1397. 666 END;
  1398. 667 IF M2Strings.Length(SecondStr)=0 THEN
  1399. 668 StringIO.WriteStr(StringIO.outp, ' New name: ');
  1400. 669 StringIO.ReadStr(StringIO.inp, mask2);
  1401. 670 ELSE
  1402. 671 StrEdit.AssignStr( SecondStr, mask2);
  1403. 672 END;
  1404. 673 IF M2Strings.Length(mask2)=0 THEN
  1405. 674 StrEdit.AssignStr( '\*.*', mask2);
  1406. 675 END;
  1407. 676 IF DifferentDrives( DirMask, mask2 ) THEN
  1408. 677 copying := TRUE;
  1409. 678 renaming := FALSE;
  1410. 679 RETURN;
  1411. 680 END;
  1412. 681 SplitPathName(path2, mask2);
  1413. 682 SplitPathName(path1, DirMask);
  1414. 683 IF M2Strings.Length(path2)=0 THEN
  1415. 684 StrEdit.AssignStr( path1, path2);
  1416. 685 END;
  1417. 686 ExpandAsterisk(mask2);
  1418. 687 REPEAT
  1419. 688 IF NOT (Drectory.SubdirectoryFile IN FileInfo.attribute) THEN
  1420. 689 MakeInfoStr( FileInfo, InfoStr );
  1421. 690 GetNewName(InfoStr, OldName, NewName);
  1422. 691 StrEdit.AssignStr( path2, TmpStr1);
  1423. 692 StrEdit.Append(TmpStr1, NewName);
  1424. 693 WriteBarAndPrompt( InfoStr, 'Rename', TmpStr1 );
  1425. 694 IF yes() THEN
  1426. 695 M2Strings.Concat(path1, OldName, TmpStr1);
  1427. 696 M2Strings.Concat(path2, NewName, TmpStr2);
  1428. 697 IF moving THEN
  1429. 698 IF Drectory.RenameFile(TmpStr1,TmpStr2) # StringIO.NoError THEN
  1430. 699 IF NOT EraseOneFile( path2, NewName ) THEN
  1431. 700 HALT;
  1432. 701 ELSE
  1433. 702 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1434. 703 Drectory.RenameFile(TmpStr1,TmpStr2));
  1435. 704 END;
  1436. 705 END;
  1437. 706 ELSE
  1438. 707 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1439. 708 Drectory.RenameFile(TmpStr1,TmpStr2));
  1440. 709 END;
  1441. 710 END;
  1442. 711 StringIO.WriteEol(StringIO.outp, null);
  1443. 712 ELSE
  1444. 713 StringIO.WriteStr(StringIO.outp, "Can't rename '");
  1445. 714 StringIO.WriteStr(StringIO.outp, FileInfo.name);
  1446. 715 StringIO.WriteEol(StringIO.outp, "' ");
  1447. 716 END;
  1448. 717 UNTIL (Drectory.FindNextFile(DirHandle, FileInfo) # StringIO.NoError)
  1449. 718 OR exiting;
  1450. 719 IF 0 # FAPI.DOSFINDCLOSE( DirHandle ) THEN END;
  1451. 720 END RenameFiles;
  1452. 721
  1453. 722 PROCEDURE UpToClusterSize(VAR TheRealSize : LONGINT);
  1454. 723 VAR
  1455. 724 clusters, NewSize : LONGINT;
  1456. 725 BEGIN
  1457. 726 clusters := TheRealSize DIV ClusterSize;
  1458. 727 INC(clusters);
  1459. 728 NewSize := ClusterSize * clusters;
  1460. 729 IF (TheRealSize + ClusterSize) # NewSize THEN
  1461. 730 TheRealSize := NewSize;
  1462. 731 END;
  1463. 732 END UpToClusterSize;
  1464. 733
  1465. 734 PROCEDURE ListFiles();
  1466. 735 VAR
  1467. 736 choice : CARDINAL;
  1468. 737 DirHandle, resultcode, linecnt : CARDINAL;
  1469. 738 VolLabel, ListedBytes, BytesFreeStr : ARRAY [0..16] OF CHAR;
  1470. 739 TmpStr, ThePath : ARRAY [0..79] OF CHAR;
  1471. 740 TmpNum, ByteCnt, BytesFree : LONGINT;
  1472. 741 dummy : BOOLEAN;
  1473. 742 BEGIN
  1474. 743 (*ListFiles*)
  1475. 744 ByteCnt := Numbers.Lc( 0 );
  1476. 745 OnTheLeft := TRUE;
  1477. 746 Drectory.VolumeLabel(TheDrive, VolLabel);
  1478. 747 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1479. 748 Drectory.GetCurrentDir(TheDrive,ThePath));
  1480. 749 DirHandle := 0FFFFH;
  1481. 750 SavedMessage := Drectory.FindFirstFile(DirMask, DirHandle, FileInfo);
  1482. 751 IF SavedMessage # StringIO.NoError THEN
  1483. 752 SayNotFound();
  1484. 753 RETURN;
  1485. 754 END;
  1486. 755 ErrStrgs.WriteErrToHandle( StringIO.ErrorOutp,
  1487. 756 Drectory.FreeDiskSpace(TheDrive,BytesFree));
  1488. 757 linecnt := 1;
  1489. 758 REPEAT
  1490. 759 TmpNum := FileInfo.size;
  1491. 760 UpToClusterSize(TmpNum);
  1492. 761 ByteCnt := ByteCnt + TmpNum;
  1493. 762 MakeInfoStr( FileInfo, TmpStr );
  1494. 763 IF OnTheLeft THEN
  1495. 764 StringIO.WriteStr(StringIO.outp, TmpStr);
  1496. 765 ELSE
  1497. 766 M2Strings.Insert(' ', TmpStr, 0);
  1498. 767 TmpStr[1] := CHR(186);
  1499. 768 StringIO.WriteStr(StringIO.outp, TmpStr);
  1500. 769 INC(linecnt);
  1501. 770 IF linecnt=26 THEN
  1502. 771 choice := KbdInput.KeyHit( KbdInput.AnyKeyNum );
  1503. 772 IF KbdInput.CAPkey(choice) = ORD('Q') THEN
  1504. 773 ErrorManager.StraightToDOS('');
  1505. 774 END;
  1506. 775 StringIO.WriteStr(StringIO.outp, '_');
  1507. 776 linecnt := 1;
  1508. 777 ELSE
  1509. 778 StringIO.WriteEol(StringIO.outp, null);
  1510. 779 END;
  1511. 780 END;
  1512. 781 OnTheLeft := NOT (OnTheLeft);
  1513. 782 SavedMessage := Drectory.FindNextFile( DirHandle, FileInfo );
  1514. 783 UNTIL SavedMessage # StringIO.NoError;
  1515. 784 IF NOT OnTheLeft THEN
  1516. 785 INC(linecnt);
  1517. 786 IF linecnt>=25 THEN
  1518. 787 choice := KbdInput.KeyHit( KbdInput.AnyKeyNum );
  1519. 788 IF KbdInput.CAPkey(choice) = ORD('Q') THEN
  1520. 789 ErrorManager.StraightToDOS('');
  1521. 790 END;
  1522. 791 END;
  1523. 792 StringIO.WriteEol(StringIO.outp, null);
  1524. 793 END;
  1525. 794 StrConv.LongIntegerToStr(ByteCnt, 1, ListedBytes);
  1526. 795 Punctuate( ListedBytes );
  1527. 796 StrConv.LongIntegerToStr(BytesFree, 1, BytesFreeStr);
  1528. 797 Punctuate( BytesFreeStr );
  1529. 798 M2Strings.Insert(';', ThePath, 0);
  1530. 799 M2Strings.Insert(VolLabel, ThePath, 0);
  1531. 800 M2Strings.Insert(' ', ThePath, 0);
  1532. 801 StrEdit.Append(ThePath, '; ');
  1533. 802 StrEdit.Append(ThePath, BytesFreeStr);
  1534. 803 StrEdit.Append(ThePath, ' free. Files above occupy ');
  1535. 804 StrEdit.Append(ThePath, ListedBytes);
  1536. 805 StrEdit.Append(ThePath, '.');
  1537. 806 StringIO.WriteStr(StringIO.outp, ThePath);
  1538. 807 IF linecnt<=23 THEN
  1539. 808 StringIO.WriteEol(StringIO.outp, null);
  1540. 809 END;
  1541. 810 IF 0 # FAPI.DOSFINDCLOSE( DirHandle ) THEN END;
  1542. 811 END ListFiles;
  1543. 812
  1544. 813
  1545. 814 BEGIN
  1546. 815 (*D*)
  1547. 816 exiting := FALSE;
  1548. 817 BigSets.AppendSet( KbdInput.YorN, "{'q', 'Q'}" );
  1549. 818 EnvironUtils.GetProgParams(DirMask);
  1550. 819 PrepareDirMask(DirMask);
  1551. 820 Drectory.GetDiskInfo( TheDrive, BytesPerSector, SectorsPerCluster,
  1552. 821 ClustersOnDisk, KindOfDisk );
  1553. 822 ClusterSize := Numbers.Lc( BytesPerSector * SectorsPerCluster );
  1554. 823 IF deleting THEN
  1555. 824 EraseFiles();
  1556. 825 ELSIF moving OR renaming THEN
  1557. 826 RenameFiles();
  1558. 827 IF copying THEN
  1559. 828 (* We do this because we may have discovered differing drive names. *)
  1560. 829 CopyFiles();
  1561. 830 END;
  1562. 831 ELSIF copying THEN
  1563. 832 CopyFiles();
  1564. 833 ELSE
  1565. 834 ListFiles();
  1566. 835 END;
  1567. 836 END D.
  1568. 730 errors