Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amdahl.UUCP Path: utzoo!linus!decvax!decwrl!amdcad!amdahl!dwl10 From: dwl10@amdahl.UUCP (Dave Lowrey) Newsgroups: net.micro.cbm Subject: Using relative files with C-Power Message-ID: <2497@amdahl.UUCP> Date: Tue, 7-Jan-86 09:12:23 EST Article-I.D.: amdahl.2497 Posted: Tue Jan 7 09:12:23 1986 Date-Received: Wed, 8-Jan-86 20:16:31 EST Organization: Amdahl Corporation, Columbia MD Lines: 59 Keywords: C-Power relative disk files C-Power has problemw when trying to access relative disk files. This is due to the fact that relative files return EOF at the end of each record, not the end of file. When C-Power's stdio routines detect any non-zero status from an I/O operation, from that point on, any other I/O requests for that file return the non-zero status. What this means for relative files is that once the first record is read, and EOF is returned at the end of that record, no other record can be read, even if the disk is positioned to a new record! I have written a short routine to fix this problem. It will reset the status byte for a specific file to zero. In order to use this program, you will need a program that can edit disk sectors, as you need to modify the .o file. I have also uploaded the .o file to the C-Power BBS. As a last resort, you can contact me, and arrange for a copy to be sent to you. 1. Enter the following program: /* * r_status(fileno) - Reset the I/O status for file 'fileno' */ extern char c_status[]; r_status(fileno) int fileno; { c_status[fileno-1] = 0; } 2. Compile the program: cc rstatus.c 3. a) Load your disk editing program b) Find the beginning track and sector for rstatus.o c) Read in that sector. d) You will see two occurances of the string c_status. These need to be changed to c$status (The '_' is 0xA4, '$' is 0x24) e) Write the modified sector back to disk. You will need to call the r_status routine after any read from a relative file that could cause a EOF to occur. What I do is call it each time I re-position the disk to a new sector. Feel free to contact me if you have any questions, concers, or suggestions (other than how to spell correctly! :-) ). -- ------------------------------------------------------------------- Dave Lowrey "To vacillate or not to vacillate, that is the question.... ....or is it?" ...!( be those of the author and not necessarily those of his most eminent employer. ]