Table of Contents

FSEFILE

Table Of Contents

  • [00006] - SUBROUTINES FOR FILE ACCESS.
  • [00076] MSEQUIP - TEST FILE ATTRIBUTES FOR MASS STORAGE.
  • [00113] TTEQUIP - TEST FILE ATTRIBUTES FOR TERMINAL.
  • [00145] WRITEABLE - TEST FILE FOR NON-READ-ONLY DISK.
  • [00170] TEST FILE ATTRIBUTES FOR LOFT.
  • [00195] GETINFO - INTERFACE TO FILINFO MACRO.
  • [00213] TEST FILE FOR FNT ASSIGNMENT.
  • [00233] VERIFY FILE AS LEGAL TO BE EDITED.
  • [00283] FILEREAD - READ A LOCAL FILE INTO FILE IMAGE BRACKET.
  • [00441] ADD AN EXTERNAL FILE TO INTERNAL FILES.

Source Code

FSEFILE.txt
  1. PROC FSEFILE;
  2. BEGIN
  3.  
  4.  
  5. #
  6. *** FSEFILE -- SUBROUTINES FOR FILE ACCESS.
  7. *
  8. * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  9. *
  10. * FSEFILE HAS THE ROUTINES TO TEST THE ATTRIBUTES OF
  11. * VARIOUS LOCAL FILES. THIS IS THEREFORE USED ONLY FOR
  12. * THE SINGLE-USER VERSION OF FSE AND IS NOT PROGRAMMED
  13. * REENTRANTLY. THIS MODULE IS A CANDIDATE FOR FUTURE
  14. * OVERLAY STRUCTURING. IT MAY BE USED BY THE FSEMAIN MODULE
  15. * AND THE FILCMD MODULE ONLY.
  16. #
  17.  
  18. DEF LISTCON #0#;
  19.  
  20. CONTROL EJECT; # UNIVERSAL DECLARES #
  21.  
  22. *IFCALL SINGLE,COMFSGL
  23. *IFCALL ONLY,COMFONL
  24. *IFCALL MULTI,COMFMLT
  25. *CALL COMFFSE
  26.  
  27. # EXTERNALS #
  28.  
  29.  
  30. XDEF
  31. BEGIN
  32. *CALL COMFXFL
  33. END
  34.  
  35. XREF ARRAY MAXADDR;; # KEY ADDRESSES IN BUFFER SEGMENT #
  36. XREF ARRAY WORKBUF;;
  37.  
  38. XREF PROC FASTRLC;
  39.  
  40. XREF
  41. BEGIN
  42. PROC PF;
  43. PROC FILINFO;
  44. PROC READ;
  45. PROC READC;
  46. PROC REWIND;
  47. PROC FLDLEN;
  48. PROC RTIME;
  49. PROC TTLIN;
  50. PROC TTSTR;
  51. PROC VDTCLO;
  52. PROC VDTOPN;
  53. PROC VDTPRT$; # PROMPT ON/OFF #
  54. END
  55.  
  56. XREF
  57. BEGIN
  58. *CALL COMFXSB
  59. *CALL COMFXSC
  60. *CALL COMFXED
  61. *CALL COMFXWK
  62. END
  63.  
  64. # COMMON DATA #
  65.  
  66. *CALL COMFDS1
  67. *CALL COMFVD2
  68. *CALL COMFDS2
  69. *CALL COMSPFM
  70. PAGE # HERE WE GO #
  71.  
  72.  
  73. FUNC MSEQUIP(NAME) B;
  74. BEGIN
  75. #
  76. ** MSEQUIP - TEST FILE ATTRIBUTES FOR MASS STORAGE.
  77. *
  78. * ENTRY NAME - NAME OF FILE TO INSPECT.
  79. *
  80. * EXIT MSEQUIP - TRUE IF ALREADY ON MASS STORAGE OR IF
  81. * ANTICIPATED TO BE ON MASS STORAGE BY DEFAULT.
  82. * OTHERWISE FALSE.
  83. *
  84. * CALLS GETINFO, TRIMNAME.
  85. *
  86. * NOTE ASSUMES CORRECT DEFINITION OF DEFAULT NAMES
  87. * FOR INPUT AND OUTPUT FILES.
  88. #
  89. ITEM NAME C(7);
  90.  
  91. FILINFSTAT = 0;
  92. IF B<0,42>NAME EQ 0 THEN
  93. BEGIN
  94. MSEQUIP=FALSE;
  95. RETURN;
  96. END
  97. MSEQUIP=TRUE;
  98. GETINFO(NAME);
  99. IF FILINFSTAT EQ 0 THEN
  100. BEGIN
  101. IF TRIMNAME(NAME) EQ DEFINPNAM THEN MSEQUIP=FALSE;
  102. IF TRIMNAME(NAME) EQ DEFOUTNAM THEN MSEQUIP=FALSE;
  103. END
  104. ELSE
  105. BEGIN
  106. IF NOT (FILINFRMS AND FILINFREAD) THEN MSEQUIP=FALSE;
  107. END
  108. END # OF MSEQUIP #
  109.  
  110. FUNC TTEQUIP(NAME) B;
  111. BEGIN
  112. #
  113. ** TTEQUIP - TEST FILE ATTRIBUTES FOR TERMINAL.
  114. *
  115. * ENTRY NAME - FILE TO TEST.
  116. *
  117. * EXIT TTEQUIP - TRUE IF FILE ALREADY ASSIGNED TO TERMINAL
  118. * EQUIPMENT, OR IF ANTICIPATED TO BE SO ASSIGNED
  119. * BY DEFAULT. OTHERWISE FALSE.
  120. *
  121. * CALLS GETINFO, TRIMNAME.
  122. *
  123. * NOTE ASSUMES CORRECT DEFINITION OF DEFAULT NAMES FOR
  124. * INPUT AND OUTPUT FILES.
  125. #
  126. ITEM NAME C(7);
  127. TTEQUIP=FALSE;
  128. IF B<0,42>NAME EQ 0 THEN RETURN;
  129. GETINFO(NAME);
  130. IF FILINFSTAT EQ 0 THEN # NOT EXIST #
  131. BEGIN
  132. IF TRIMNAME(NAME) EQ DEFINPNAM THEN TTEQUIP=TRUE;
  133. IF TRIMNAME(NAME) EQ DEFOUTNAM THEN TTEQUIP=TRUE;
  134. END
  135. ELSE # FILE ALREADY EXIST #
  136. BEGIN
  137. IF FILINFTTY THEN TTEQUIP=TRUE;
  138. END
  139. END # OF TTEQUIP #
  140.  
  141.  
  142. FUNC WRITEABLE(NAME) B;
  143. BEGIN
  144. #
  145. ** WRITEABLE - TEST FILE FOR NON-READ-ONLY DISK.
  146. *
  147. * ENTRY NAME - FILE TO INSPECT.
  148. *
  149. * EXIT - WRITEABLE - TRUE IF AND ONLY IF FILE IS ON
  150. * MASS STORAGE AND HAS NO ACCESS RESTRICTIONS.
  151. *
  152. * CALLS MSEQUIP.
  153. *
  154. * NOTE CODING ASSUMES GETINFO WILL BE CALLED FOR THIS
  155. * FILE NO LATER THAN COMPLETION OF MSEQUIP.
  156. #
  157. ITEM NAME C(7);
  158. WRITEABLE=FALSE;
  159. IF MSEQUIP(NAME) THEN
  160. BEGIN
  161. WRITEABLE=FILINFWRIT;
  162. IF FILINFSTAT EQ 0 THEN WRITEABLE=TRUE;
  163. END
  164. END # OF WRITEABLE #
  165.  
  166.  
  167. FUNC LOCALFILE(NAME) B;
  168. BEGIN
  169. #
  170. ** LOCALFILE - TEST FILE ATTRIBUTES FOR LOFT.
  171. *
  172. * ENTRY NAME - FILE TO INSPECT.
  173. *
  174. * EXIT LOCALFILE - TRUE IF AND ONLY IF FILE IS ON
  175. * MASS STORAGE, HAS WRITE PERMISSION, AND IS OF
  176. * LOCAL FILE TYPE.
  177. *
  178. * CALLS WRITEABLE.
  179. *
  180. * NOTE ASSUMES GETINFO IS CALLED BY WRITEABLE.
  181. #
  182. ITEM NAME C(7);
  183. LOCALFILE=FALSE;
  184. IF WRITEABLE(NAME) THEN
  185. BEGIN
  186. IF FILINFFT EQ 0
  187. OR FILINFFT EQ 6 THEN LOCALFILE=TRUE;
  188. END
  189. END # OF LOCALFILE #
  190.  
  191.  
  192. PROC GETINFO(NAME);
  193. BEGIN
  194. #
  195. ** GETINFO - INTERFACE TO FILINFO MACRO.
  196. *
  197. * ENTRY NAME - FILE TO PROCESS.
  198. *
  199. * EXIT FILINFPARMS ARRAY IS FILLED IN.
  200. *
  201. * CALLS TRIMNAME, FILINFO.
  202. #
  203. ITEM NAME C(7), NEWNAME C(7);
  204. NEWNAME=TRIMNAME(NAME);
  205. FILINFNAME=NEWNAME;
  206. FILINFO(FILINFPARMS);
  207. END # OF GETINFO #
  208.  
  209.  
  210. FUNC ASSGNFILE(NAME) B;
  211. BEGIN
  212. #
  213. ** ASSGNFILE - TEST FILE FOR FNT ASSIGNMENT.
  214. *
  215. * ENTRY NAME - FILE TO INSPECT.
  216. *
  217. * EXIT ASSGNFILE - TRUE IF AND ONLY IF THIS JOB HAS
  218. * AN FNT FOR THE FILE.
  219. *
  220. * CALLS GETINFO.
  221. #
  222. ITEM NAME C(7);
  223. ASSGNFILE=FALSE;
  224. IF B<0,42>NAME EQ 0 THEN RETURN;
  225. GETINFO(NAME);
  226. IF FILINFSTAT NQ 0 THEN ASSGNFILE=TRUE;
  227. END # OF ASSGNFILE #
  228.  
  229.  
  230. PROC VFYFILE(NAME,MODE);
  231. BEGIN
  232. #
  233. ** VFYFILE - VERIFY FILE AS LEGAL TO BE EDITED.
  234. *
  235. * ENTRY NAME - FILE TO INSPECT.
  236. * MODE - POSITIVE IMPLIES USE ERRJUMP FOR FAILURES,
  237. * NEGATIVE IMPLIES ABORT THE JOB STEP VIA MORTAL.
  238. *
  239. * EXIT TO CALLER IF FILE IS LEGAL, OTHERWISE TO
  240. * SPECIFIED ERROR ROUTINE WITHOUT RETURN.
  241. *
  242. * CALLS ERRJUMP, MORTAL, ERROR(INTERNAL), COMPARE(INTERNAL).
  243. #
  244. ITEM NAME C(7), MODE I;
  245.  
  246. PROC ERROR(STR);
  247. BEGIN
  248. ITEM STR C(40);
  249. IF MODE GQ 0 THEN ERRJUMP(STR);
  250. MORTAL(STR);
  251. END
  252.  
  253. PROC COMPARE(PARM);
  254. BEGIN
  255. ITEM PARM C(7), NAME1 C(7), NAME2 C(7);
  256. NAME1=TRIMNAME(NAME);
  257. NAME2=TRIMNAME(PARM);
  258. IF NAME1 EQ NAME2 THEN ERROR("RESERVED FILE$");
  259. END
  260.  
  261. COMPARE(INPTNAM);
  262. COMPARE(OUTPNAM);
  263. COMPARE(WORKNAM);
  264. COMPARE("ZZZMOVE");
  265. IF NOT MSEQUIP(NAME) THEN
  266. BEGIN
  267. IF FILINFSTAT NQ 0 AND FILINFRMS THEN
  268. BEGIN # IF FILE HAS NO READ PERMISSION #
  269. ERROR("FILE DOES NOT HAVE READ PERMISSION$");
  270. END
  271. ELSE
  272. BEGIN # IF FILE IS NOT ON DISK #
  273. ERROR("FILE MUST BE ON DISK$");
  274. END
  275. END
  276. END # OF VFYFILE #
  277. PAGE # FILE READ SUBROUTINE #
  278.  
  279.  
  280. PROC FILEREAD;
  281. BEGIN
  282. #
  283. ** FILEREAD - READ A LOCAL FILE INTO FILE IMAGE BRACKET.
  284. *
  285. * NOTE THAT TO SAVE THE CPU OVERHEAD OF RELOCATING THE
  286. * POINTER STACKS FOR EVERY INSERTION, WE CALL WORKIO
  287. * DIRECTLY, THEN WE CALL RELOCATE TO CORRECT FOR BYPASSING
  288. * THE "INSY" INTERFACE.
  289. *
  290. * NOTE THAT THE "USRBRK" FLAG IS CONTINUALLY CHECKED
  291. * TO DETECT AN EXTERNAL INTERRUPT.
  292. *
  293. * ENTRY FILNUM - WHICH BRACKET.
  294. * FILEFET - ALREADY INITIALIZED.
  295. * ASCII[FILNUM] - CHARACTER SET.
  296. *
  297. * EXIT NUMBERED[FILNUM] - WHETHER FILE REALLY NUMBERED.
  298. * FILEFET - AT EOI, OR INDETERINATE IF USER BREAK.
  299. *
  300. * CALLS READ, READC, CONVIN, GETLNUM, TRIMPAD, INS, FASTRLC.
  301. *
  302. * USES WIDTHFOUND.
  303. #
  304. DEF AVERAGE #500#; # AVERAGE FILE SIZE #
  305. DEF TWOANAHALF #2500#; # TWO AND A HALF SECONDS #
  306. ITEM LOOPCTL, RESULT, LASTNUM, ASCIITYPE, MAXL, RECYCLE, FIRSTPOS;
  307. ITEM ZERO=0;
  308. ITEM COUNTER I; # LINE COUNTER #
  309. ITEM SAMPLE I; # LINE SAMPLE RATE #
  310. ITEM STARTTIME I; # REAL TIME CLOCK (START) #
  311. ITEM CHECKTIME I; # REAL TIME CLOCK (CHECK) #
  312. IF SCREENMODE OR DONTPRINT OR NOT INTERACT
  313. OR READNAM EQ "FSEPROC" THEN
  314. BEGIN # IF NO MESSAGE SHOULD BE SENT #
  315. COUNTER = 0;
  316. END
  317. ELSE
  318. BEGIN # MESSAGE MAY BE SENT #
  319. COUNTER = 1;
  320. SAMPLE = AVERAGE;
  321. RTIME(STARTTIME);
  322. STARTTIME = B<24,36>STARTTIME;
  323. END
  324. REWIND(FILEFET,1);
  325. READ(FILEFET,0);
  326. FIRSTPOS=CURRENT;
  327. RESULT=0;
  328. MAXL=0;
  329. RECYCLE=0;
  330. LASTNUM=0;
  331. FOR LOOPCTL=LOOPCTL WHILE RESULT EQ 0 AND USRBRK EQ 0 DO
  332. BEGIN
  333. ASCIITYPE=ASCII[FILNUM]; # CHARACTER SET FOR FILE #
  334. LINE[0]=0;
  335. READC(FILEFET,TMPLIN,BUFWID2P1,RESULT);
  336. IF COUNTER NQ 0 THEN
  337. BEGIN # IF MESSAGE STILL TO ISSUE #
  338. COUNTER = COUNTER + 1;
  339. IF COUNTER GR SAMPLE THEN
  340. BEGIN # IF SAMPLE SIZE REACHED #
  341. RTIME(CHECKTIME);
  342. CHECKTIME = B<24,36>CHECKTIME - STARTTIME;
  343. IF CHECKTIME GR TWOANAHALF THEN
  344. BEGIN # IF ENOUGH TIME HAS PASSED #
  345. TTSTR("BUILDING: $");
  346. TTLFN(READNAM);
  347. TTLIN(" ONE MOMENT PLEASE$");
  348. COUNTER = 0; # ONE MESSAGE IS ENOUGH #
  349. VDTCLO(COUNTER); # FLUSH OUTPUT,NO RECALL #
  350. END
  351. ELSE
  352. BEGIN # COMPUTE PROBABLE SAMPLE COUNT #
  353. SAMPLE = (SAMPLE*TWOANAHALF)/CHECKTIME;
  354. END
  355. END
  356. END
  357. IF RESULT GR 0 THEN
  358. BEGIN
  359. ASCIITYPE=1; # CHARACTER SET FOR EORCON #
  360. TMPLINE[0]=EORCON;
  361. FILECODE=1;
  362. READ(FILEFET,1);
  363. IF FILECODE EQ O"31" THEN RESULT=-1;
  364. ELSE IF FILECODE NQ O"1031" OR FILEIN NQ FILEOUT THEN
  365. BEGIN
  366. RESULT=0;
  367. END
  368. END
  369. IF RESULT EQ -1 THEN
  370. BEGIN
  371. ASCIITYPE=1; # CHARACTER SET FOR EOFCON #
  372. RESULT=0;
  373. TMPLINE[0]=EOFCON;
  374. FILECODE=1;
  375. READ(FILEFET,0);
  376. END
  377. IF RESULT EQ 0 THEN # PREPARE LINE OF TEXT #
  378. BEGIN
  379. MAXL=MAXL+1; # COUNT RELOCATION FACTOR #
  380. CONVIN(LIN,ASCIITYPE);
  381. IF NUMBERED[FILNUM] NQ 0 THEN # VERIFY/ADJUST SEQUENCE NUMBERS #
  382. BEGIN
  383. GETLNUM;
  384. IF LINENO LQ LASTNUM THEN # FILE IS NOT REALLY SEQUENCED #
  385. BEGIN
  386. NUMBERED[FILNUM]=0;
  387. CHANGED[FILNUM]=0; # TAKE BACK FLAG FOR ADJUSTMENTS #
  388. IF MAXL GR 1 THEN
  389. BEGIN
  390. REWIND(FILEFET,1);
  391. READ(FILEFET,0);
  392. POSZ(FIRSTPOS);
  393. RECYCLE=MAXL-1;
  394. MAXL=0;
  395. TEST LOOPCTL;
  396. END
  397. END
  398. ELSE # ADJUST SEQUENCING DIGITS #
  399. BEGIN
  400. IF WIDTHFOUND EQ NUMWIDTH THEN
  401. BEGIN # FIX INTERVENING BLANK #
  402. GETCHAR(LINE,NUMWIDTH,LINCTR);
  403. IF BLANKS NQ 0 AND LINCTR NQ CBLANK THEN
  404. BEGIN
  405. RSHIFT(LIN,NUMWIDTH,1);
  406. SETCHAR(LINE,NUMWIDTH,CBLANK);
  407. CHANGED[FILNUM]=1; # FLAG THAT WE ADJUSTED TEXT #
  408. END
  409. END
  410. IF WIDTHFOUND GR 0 AND WIDTHFOUND LS NUMWIDTH
  411. AND NUMMODE EQ NUMST"PREFER" THEN
  412. BEGIN # ADJUST DIGITS #
  413. CHANGED[FILNUM]=1; # FLAG THAT WE ADJUSTED TEXT #
  414. SETLNUM;
  415. GETLNUM;
  416. END
  417. END
  418. END
  419. LASTNUM=LINENO;
  420. TRIMPAD;
  421. IF RECYCLE NQ 0 THEN
  422. BEGIN
  423. ZERO = = P<LINEBUF>; # POSITION INVISIBLY #
  424. FWDZ; # POSITION INVISIBLY #
  425. ZERO = = P<LINEBUF>; # POSITION INVISIBLY #
  426. REP;
  427. RECYCLE=RECYCLE-1;
  428. END
  429. ELSE INS;
  430. END
  431. END
  432. FASTRLC(REGSTACK,MAXREG+1,CURRENT-MAXL+1,MAXL);
  433.  
  434. END # OF FILEREAD #
  435. PAGE # ADDFILE CONTROLS FILEBUILD #
  436.  
  437.  
  438. PROC ADDFILE;
  439. BEGIN
  440. #
  441. ** ADDFILE - ADD AN EXTERNAL FILE TO INTERNAL FILES.
  442. *
  443. * ENTRY FILNUM - WHICH BRACKET.
  444. * READNAM - FILE NAME.
  445. * CHARPARM - CHARACTER SET PREFERENCE OR DEFAULT.
  446. * GETPARM - PERMANENT/LOCAL PREFERENCE OR DEFAULT.
  447. * ALLASCII - DEFAULT CHARACTER SET.
  448. * SMALLFIELD - WHETHER FIELD LENGTH NOW SMALL OR LARGE.
  449. * BOTC(FILECTL) - BRACKETS FILE DIRECTORY AREA.
  450. * TOPA(AUDITCTL) - BRACKETS AUDIT TRAIL.
  451. * NUMMMODE - WHAT TO DO WITH EMPTY FILE.
  452. * SCNFDINIT - 1 IF FILE IS INITIAL EDIT FILE,
  453. * 0 OTHERWISE.
  454. *
  455. * EXIT GETPARM - INDICATES WHETHER GET REALLY DONE.
  456. * LOCKED[FILNUM] - SET BY FILE ATTRIBUTES.
  457. * ASCII[FILNUM] - SET BY PARAMETER.
  458. * CHANGED[FILUM] - FALSE.
  459. * NUMBERED[FILNUM] - SET BY NUMMODE AND FILE CONTENT.
  460. * BOTC, TOPA - RELOCATED, ALSO VARIOUS OTHERS.
  461. * CURRENT, CURF(FILNUM) - TOP OF FILE.
  462. * FDLF(FILNUM) - UPDATED.
  463. * TOPF(FILNUM), BOTF(FILNUM) - BRACKET THE FILE.
  464. *
  465. * USES FILEFET, DSKSIZ, UTILFET.
  466. *
  467. * CALLS VFYFILE, FLDLEN, PAUSEIO, TRIMNAME, ASSGNFILE,
  468. * MAKEFET, GET, WRITEABLE, POSZ, FORMFDL, INSY,
  469. * FILEREAD, REWIND.
  470. #
  471. ITEM NEWNAME C(7);
  472.  
  473. VFYFILE(READNAM,0);
  474.  
  475. IF SMALLFIELD THEN
  476. BEGIN
  477. FLDLEN(LOC(MAXADDR)+4);
  478. PAUSEIO; # DRAIN BUFFERS SO WE CAN ... #
  479. DSKSIZ=INIDSKSIZ; # ... ENLARGE BUFFERS #
  480. END
  481.  
  482. NEWNAME=TRIMNAME(READNAM);
  483. IF GETPARM EQ 1 AND NOT ASSGNFILE(READNAM) THEN GETPARM=2;
  484. IF GETPARM EQ 2 THEN
  485. BEGIN
  486. PF("GET",READNAM,READNAM,"RC",PFMERROR,"EM",PFMMSG,"EL","40",0);
  487. IF PFMERROR EQ 0 THEN
  488. BEGIN # IF POSSIBLE CALL TO *CPUPFM* #
  489. IF SCREENMODE AND TABTYPHEAD[0] THEN
  490. BEGIN # IF RUNNING WITH TYPE AHEAD #
  491. VDTPRT$(0); # ASSURE PROMPT IS OFF #
  492. END
  493. END
  494. IF PFMERROR EQ FNF THEN
  495. BEGIN
  496. PF("ATTACH",READNAM,READNAM,"RC",PFMERROR,"M","W","NA","YES",
  497. "SR","NF","EM",PFMMSG,"EL","40",0);
  498. END
  499. IF PFMERROR NQ 0 THEN
  500. BEGIN
  501. C<0,18>ERRSTRING="USING LOCAL FILE -";
  502. C<18,40>ERRSTRING=C<0,40>PFMMSG;
  503. C<58,1>ERRSTRING="$";
  504. END
  505. END
  506. IF GETPARM GQ 2 THEN GETPARM=0;
  507. FILENAM[FILNUM]=NEWNAME;
  508. CHANGED[FILNUM]=0;
  509. LOCKED[FILNUM]=0;
  510. INITFILE[FILNUM]=SCNFDINIT;
  511. ASCII[FILNUM]=CHARPARM;
  512. IF CHARPARM EQ 0 AND ALLASCII THEN ASCII[FILNUM]=2;
  513. IF NOT WRITEABLE(READNAM) THEN LOCKED[FILNUM]=1;
  514. POSZ(BOTC(FILECTL)-1);
  515. FORMFDL(FILNUM);
  516. INSY;
  517. FDLF(FILNUM)=CURRENT;
  518.  
  519. # NEW FILE BRACKET GOES BEFORE AUDIT TRAIL BRACKET #
  520. POSZ(TOPA(AUDITCTL)-1);
  521. TOPF(FILNUM)=CURRENT;
  522. MAKEFET(FILEFET,READNAM,FILEBUF,DSKSIZ);
  523. IF ASSGNFILE(READNAM) THEN
  524. BEGIN
  525. FILEREAD;
  526. REWIND(FILEFET,0);
  527. END
  528. LINE[0]=NULLIN;
  529. INSY;
  530. BOTF(FILNUM)=CURRENT;
  531.  
  532. IF BOTF(FILNUM) EQ TOPF(FILNUM)+1 THEN
  533. BEGIN
  534. POSZ(TOPF(FILNUM));
  535. IF NUMMODE EQ NUMST"INTERPRET" THEN NUMBERED[FILNUM]=0;
  536. END
  537. ELSE POSZ(TOPF(FILNUM)+1);
  538. CURF(FILNUM)=CURRENT;
  539.  
  540. IF SMALLFIELD THEN
  541. BEGIN
  542. PAUSEIO; # DRAIN BUFFERS SO WE CAN ... #
  543. DSKSIZ=DISKSIZE; # ... SHRINK BUFFERS BACK #
  544. FLDLEN(LOC(WORKBUF)+DSKSIZ+4);
  545. END
  546.  
  547. END # OF ADDFILE #
  548.  
  549.  
  550. END TERM