[Numpy-discussion] numarray memmap "reopen" problem

Sebastian Haase haase at msg.ucsf.edu
Fri Dec 5 09:56:01 CST 2003


Hi,
I create a memmap file with mode 'w+'. But I forgot to assign a name to the
object. So just call the same function again.
But this time I get  a "no such file error" ! a) the file actually does
exist , b) It shouldn't care, because mode == 'w+'.
This is the traceback I get :  (len == 1024)

>>> Mrc.bindMrc("C:/mm7.mrc", mode='w+')
array([], type=Int8)
>>> a = Mrc.bindMrc("C:/mm7.mrc", mode='w+')
Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "X:\PrWin\Priithon\Mrc.py", line 9, in bindMrc
    a = Mrc(fn,mode)
  File "X:\PrWin\Priithon\Mrc.py", line 43, in __init__
    self.m = mm.open(filename=path, mode=mode, len=len)
  File "X:\PrWin\numarray\memmap.py", line 762, in open
    return Memmap(filename, mode, len)
  File "X:\PrWin\numarray\memmap.py", line 269, in __init__
    file = _open(filename, (mode == "c" and "r" or mode))
  File "X:\PrWin\numarray\memmap.py", line 236, in _open
    return __open(file, mode+"b")
IOError: [Errno 2] No such file or directory: 'C:/mm7.mrc'


Any idea how this error message could come about ?

Regards,
Sebastian Haase





More information about the Numpy-discussion mailing list