comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Simple File I/O
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Simple File I/O [message #58351] Fri, 25 January 2008 16:50
Gary is currently offline  Gary
Messages: 4
Registered: January 2008
Junior Member
This questions stems, as much as anything, from my newness to
programming in general. I would like to take a pixmap my code
generates, save it as a file for later use, and then read it in later
after having restarted the code. Thus far, I've tried simply using
writeu and readu. The error comes when readu is reached producing the
error, readu: end of file encountered. I use TVRD() to generate a
float array from the pixmap then writeu this to a file. This produces
a file of byte format? On the other end, I generate a float array hard
coded to the same size as the original pixmap, and simply use readu
into the float array, whereupon I get the end of file encountered
error. I think I'm missing something between the conversion between
the original float array to bytes and then back again. Also, fstat
tells me that there are four extra bytes to the number of cells in the
original array. 460x920 = 423200 cells, but fstat gives a file size of
423204 bytes. I'm guessing its really simple and I'm just missing it.
Any and all help much appreciated.

-g
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Long command line wordwrap
Next Topic: Resampling from cumulative probability distribution

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:38:55 PDT 2025

Total time taken to generate the page: 0.00543 seconds