[Numpy-discussion] Unexpected tofile() behavior

Keith Goodman kwgoodman@gmail....
Thu Feb 4 15:33:31 CST 2010


On Thu, Feb 4, 2010 at 1:28 PM, Jeffery Kline <jeffery.kline@gmail.com> wrote:
> I am experiencing unexpected behavior with the tofile() function.  I try to write two files with but distinct names, but only one of the files is written.
>
> The following code illustrates. For me, it only writes the file 't.bin'.
>
> from numpy import *
> t=arange(0,1,0.1)
> T=arange(0,1,0.1)
> t.tofile('t.bin')
> T.tofile('T.bin')
>
> Meanwhile, the following code works as I expect by writing 't.bin' and 'S.bin':
>
> from numpy import *
> t=arange(0,1,0.1)
> T=arange(0,1,0.1)
> t.tofile('t.bin')
> T.tofile('S.bin')
>
> Am I doing something stupid or overlooking something obvious?
>
> My system is Mac os x 10.6.2, running python 2.6.4.
> Jeff

Maybe your filesystem is not case sensitive? Mine is:

>> x.tofile('t.bin')
>> x.tofile('T.bin')
>> !ls *.bin
t.bin  T.bin


More information about the NumPy-Discussion mailing list