CompuServe Thread

#Random File I/O

3 messages in this thread
#106641From: Jim JoslinJan 31, 1988 8:46 PM
Hello, I am relatively new to Amiga-dom and C programming. I have had enourmous difficulty finding information in any of my C or Amiga specific manuals concerning random I/O operations on the Amiga. AmigaBasic <Read Microsoft> seems to have the capability as I have used it on other machines (FIELD, GET#, PUT#, etc.) but I would rather do it in C (or Modula2 or Pascal or even Assembler). Any information/suggestions would be greatly appreciated. Thanks, Jim Joslin {72275,747}
#106679From: Don Curtis/SYSOPJan 31, 1988 10:29 PM
Jim, You can use any of the C library functions such as get(), put(), read() write() or their file oriented versions fget(), fput(), etc. Get a good book on C such as Harbison and Steele's 'C: A reference manual' or the new McGraw Hill C Reference manual. Don
#106749From: FPSCFeb 1, 1988 7:05 AM
Jim, There aren't AmigaDOS routines to automatically read/write specific records of a file, however, you can use the seek routine to position you at the correct place within the file, and then read/write the correct number of bytes for your record. If you decide to do this project in TDI modula-2, I have uploaded a set of routines in the Moudla DL (12) which do buffered random file I/O of the type you are describing (just give them a record number and they'll do it) along with routines to generate a Btree (actually B+tree) indexes for these files. Chip Orange