Unexpected tofile() behavior

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

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

to, 2010-02-04 kello 15:28 -0600, Jeffery Kline kirjoitti:
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') [clip] My system is Mac os x 10.6.2, running python 2.6.4.
http://davidwinter.me.uk/articles/2008/05/17/mac-os-xhfs-case-insensitive-wh...

Jeffery Kline wrote:
Am I doing something stupid or overlooking something obvious?
My system is Mac os x 10.6.2, running python 2.6.4.
Mac OS is case=preserving, but not case dependent with file names, I think the OS is writing over your file. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov

On Feb 4, 2010, at 4:02 PM, Christopher Barker wrote:
Jeffery Kline wrote:
Am I doing something stupid or overlooking something obvious?
My system is Mac os x 10.6.2, running python 2.6.4.
Mac OS is case=preserving, but not case dependent with file names, I think the OS is writing over your file.
-Chris
question answered -- thanks for the responses. I hadn't noticed this behavior on OS X before now. Jeff
participants (4)
-
Christopher Barker
-
Jeffery Kline
-
Keith Goodman
-
Pauli Virtanen