• Subject: Re: Opening a save file
  • From: Dave McKenzie <davemck@xxxxxxxxxx>
  • Date: Tue, 18 Jul 2000 18:01:40 -0700

Save files can be read with the normal record-IO library functions.  Here's a
skeleton pgm that reads thru a save file:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <recio.h>
#include <xxfdbk.h>

void main( void )
{
  int          eof;
  char         savfRec[528];
  _RFILE      *savf;
  _RIOFB_T    *fb;

  savf = _Ropen("MYSAVF", "rr");

  do {
    fb = _Rreadn(savf, &savfRec, sizeof(savfRec), __DFT);
    eof = (fb->num_bytes == EOF);

    if (!eof) {

      /*  Do something with record  */

    }
  } while(!eof);

  _Rclose(savf);
  return;
}

--Dave

Adam White wrote:

> Is there a way (besides using the database api's) to open a save file.  I've
> tried using fopen() and open() but to no avail.
> I'm compiling with SYSIGCOPT(*ALL)
>
> Any help much appreciated
> Regards
> Adam White
> SLIC Systems Ltd
> adam@slic-systems.com
> www.slic-systems.com

+---
| This is the C/400 Mailing List!
| To submit a new message, send your mail to C400-L@midrange.com.
| To subscribe to this list send email to C400-L-SUB@midrange.com.
| To unsubscribe from this list send email to C400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: bob@cstoneindy.com
+---

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact [javascript protected email address].