Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: BinaryIO

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57818] Re: [mg57797] BinaryIO
  • From: "Dale R. Horton" <daleh at wolfram.com>
  • Date: Thu, 9 Jun 2005 05:18:00 -0400 (EDT)
  • References: <200506080843.EAA13826@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

BinaryWrite is like Write. It does not close it's streams when it's 
finished. So the second BinaryWrite appends to the file. To overwrite, 
you should first close the stream.

n = 1000000;
TSout = Table[{FromDate[{2000, 1, 1, 0, 0, 0}] + i, Random[]}, {i, n}];
stream = OpenWrite["binTS.dat", BinaryFormat -> True];
BinaryWrite[stream, TSout, {"Real64", "Real64"}]; // Timing
Close[stream];
TSin = BinaryReadList["binTS.dat", {"Real64", "Real64"}]; // Timing
TSout == TSin

-Dale
On Jun 8, 2005, at 3:43 AM, Marko Kastens wrote:

> Hi,
>
> I have just updated to Mathematica 5.1.1.0 and trying the new 
> BinaryIO-Commands to
> increase the IO speed. But ... here is something strange:
>
>
> n = 1000000;
> TSout = Table[{FromDate[{2000, 1, 1, 0, 0, 0}] + i, Random[]}, {i, n}];
> BinaryWrite["binTS.dat", TSout, {"Real64", "Real64"}]; // Timing
> TSin = BinaryReadList["binTS.dat", {"Real64", "Real64"}]; // Timing
> TSout == TSin
>
>
> Evaluating these lines with a fresh kernel: everything is ok. Evaluate 
> them a
> second time and TSout==TSin produce a _False_. Restarting the kernel:
> everything is ok.
> Every time I (try to) overwrite the file _binTS.dat_ I got a False. It 
> seems to
> me that the routine is not able to overwrite files.
>
> Hmmm, any suggestions?
>
> marko
>


  • References:
    • BinaryIO
      • From: Kastens@Hamburg.BAW.DE (Marko Kastens)
  • Prev by Date: Re: Mathematica equivalent complexplot
  • Next by Date: Re: a question about subscript
  • Previous by thread: BinaryIO
  • Next by thread: Re: BinaryIO