A Dimarts 22 Agost 2006 21:45, Alexandre Fayolle va escriure:
> 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
Mmm, no idea. But apprently the code that is failing is:
parentname = os.path.dirname(filename)
if not os.access(parentname, os.W_OK):
raise IOError("directory ``%s`` exists but it can not be written"
% (parentname,))
Can yoy run this in your Windows machine and tell me whether os.access is
reporting that you have writing permission in "../../Bureau"? Can you
experiment passing an absolute path or with backslashes?
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