On 11 June 2004 14:46, Mike Aizatsky wrote:
> Hello,
>
> I'm having strange problems with binary file output. In my
> application I'm preparing the [Word8], then doing just 4 operations:
>
> 1. openBinaryFile
> 2. newListArray from my list
> 3. hPutArray
> 4. file close
>
> Everything works ok till I change one function deep in computational
> code. The change is like this one:
> was:
> foo :: ...... -> Double
> foo params = result where .....
>
> now:
>
> foo :: ...... -> Double
> foo params = result*g(params) where .....
>
> After the change, while the list is of the same size (I've traced the
> list size and array size), the output is of different size! While the
> array has 849,352 the resulting file is 10K larger. I've tried to
> write the elements from array using hPutChar instead of hPutArray.
> The file still has the size, not equal to array size.
>
> Unfortunately, any attempts to product small self-contained example
> have failed. But I can easily reproduce it in my app. Any ideas what
> should I try to nail down the problem? May this be a buffering issue?
> Can I turn buffers off/make them larger?
Try turning off buffering with hSetBuffering. Nevertheless, we probably
need a repeatable example in order to track down the bug. 10k larger is
more than the size of the buffer, so it's possible something else is
going on.
What do the contents of the file look like? Is it padded with zeroes?
Cheers,
Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs