• Subject: Re: Wite to a save file with _RWrite
  • From: Dave McKenzie <davemck@xxxxxxxxxx>
  • Date: Thu, 16 Nov 2000 17:20:48 -0800

Here's a little pgm that does that.  SAVF528 is a rcdlen(528) physical 
data copied from a savf file with FTP, and ASAVF is a save file.


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

static _RFILE  *pfFp;
static _RFILE  *savFp;

int  main(int argc, char **argv)
  char  aRec[528];

  pfFp = _Ropen("SAVF528", "rr");
  savFp = _Ropen("ASAVF", "wr");

  do {
    _Rreadn(pfFp, aRec, 528, __DFT);
    _Rwrite(savFp, aRec, 528);
  } while (pfFp->riofb.num_bytes != EOF);


Tim McCarthy wrote:

> I'm trying to write to a save file using _RWrite. The data in the buffer
> is in valid save file format and the length to write is 528. I keep
> getting a "data was truncated on an input, output or update". Anyone
> done this before that can steer me in the right direction?
> TrailBlazer Systems, Inc.
> http://www.as400ftp.com
> AS/400 Communications & E-Commerce Solutions
> Chaos, panic and disorder...my work here is done.

| 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 ...


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 on our policy page. If you have questions about this, please contact [javascript protected email address].