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 = open('../../Bureau/toto.txt', 'w')
> >>> f.write('toto')
> >>> f.close()
> >>> import tables
> >>> hdf = 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
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 win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tables
>>> f=tables.openFile('../../Escritorio/hola.h5', 'w')
>>> f.createGroup('/', 'hola')
/hola (Group) ''
children := []
>>> f.root.hola
/hola (Group) ''
children := []
>>>
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 win32
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? That's
very bizarre indeed.
Cheers,
--
>0,0< Francesc Altet http://www.carabos.com/
V V Cárabos Coop. V. Enjoy Data
"-"
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users