delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/19/20:00:55

Sender: nate AT cartsys DOT com
Message-ID: <36CE07CC.87E6DCDC@cartsys.com>
Date: Fri, 19 Feb 1999 16:54:36 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.1 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: HELP: File-I/O under DJGPP ???
References: <01be5c52$32c81680$96ab9bc1 AT default>
Reply-To: djgpp AT delorie DOT com

Spike wrote:
> 
> Hi!
> 
> I am writing a little class for loading .pcx-files and showing them on the
> screen.
> My problem is that I use the following code to open a .pcx-file and read it
> as follows:
> 
> int handle;
> handle=open(name);

If this isn't just pseudo-code, note that `open' has some other args.

> if (handle<0) { cout<<"ERROR!"; exit(1); }
> 
> Clear so far? I hope so, as this was just the opening of the file.
> 
> I read it like this:
> 
> int variable;
> read(handle, variable, sizeof(int));
> 
> OK?

No.  Should be `&variable'.
 
> My Problem now is that I need to change my position in the file (normally I
> use fseek or such a kind but here it doesn't work).
> What can I do to change my position?

info libc alpha lseek
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019