From: Francesc A. <fa...@ca...> - 2006-08-24 20:49:59
|
A Dimarts 22 Agost 2006 21:45, Alexandre Fayolle va escriure: > Hi, > > I'm running into a weird problem with an application using pytables on > Windows XP: tables.openFile refuses to create a file on the Desktop, > because 'the directory exists but it cannot be written'. At the same > time, I'm able to use the builtin function open() to create a file in > the same directory. Here is a sample interactive session ('Bureau' is > > MS french for 'Desktop'): > >>> f =3D open('../../Bureau/toto.txt', 'w') > >>> f.write('toto') > >>> f.close() > >>> import tables > >>> hdf =3D tables.openFile('../../Bureau/toto.h5', 'w') > > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "C:\Python24\Lib\site-packages\tables\File.py", line 227, in > openFile > METADATA_CACHE_SIZE, nodeCacheSize) > File "hdf5Extension.pyx", line 580, in hdf5Extension.File.__new__ > File "C:\Python24\Lib\site-packages\tables\utils.py", line 587, in > checkFileAccess > raise IOError("directory ``%s`` exists but it can not be written" > IOError: directory ``../../Bureau`` exists but it can not be written I've just tried this in a Windows machine (with Spanish language) and this= =20 seems to work for me (using WinXP with SP1, I think): C:\Documents and Settings\Francesc\Escritorio\pytables-1.3\std-1.3>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on wi= n32 Type "help", "copyright", "credits" or "license" for more information. >>> import tables >>> f=3Dtables.openFile('../../Escritorio/hola.h5', 'w') >>> f.createGroup('/', 'hola') /hola (Group) '' children :=3D [] >>> f.root.hola /hola (Group) '' children :=3D [] >>>=20 Also, I've double checked that os.access is working properly: C:\Documents and Settings\Francesc\Escritorio\pytables-1.3>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on wi= n32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.access('..\..\Escritorio', os.W_OK) True >>> So everything is working well here. Mmm... perhaps a bug in French Win? Tha= t's=20 very bizarre indeed. Cheers, =2D-=20 >0,0< Francesc Altet =C2=A0 =C2=A0 http://www.carabos.com/ V V C=C3=A1rabos Coop. V. =C2=A0=C2=A0Enjoy Data "-" |