Thank you Frank.<br>I will investigate more deeply using your suggestion.<br><br>Just a simple question:<br>what do you think about the strange "filename" behaviour? (A file named "D:\\blabla.ext" works while "D:\\myFolder\\blabla.ext" does not)
<br><br>Thanks a lot.<br><br>Best regards,<br>Daniele<br><br><br><br><div><span class="gmail_quote">On 1/9/07, <b class="gmail_sendername">Frank Warmerdam</b> <<a href="mailto:warmerdam@pobox.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
warmerdam@pobox.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Daniele Romagnoli wrote:<br>> However, using the SAME code within the body of the "write" method of
<br>> the MyJP2KImageWriter class (which extends ImageWriter), it does not work.<br>> (Such a method will be called during an ImageWrite operation performed<br>> using JAI-ImageIO toolkit).<br><br>Daniele,<br><br>
I'm afraid I am unclear of the differences between the standalone JUnit<br>test, and the MyJP2KImageWriter case. Is, by any chance, the second running<br>as a web service with different permissions than when run directly by you
<br>under your user account?<br><br>> containing the code<br>><br>> hFile = CreateFile( pszFilename, dwDesiredAccess, FILE_SHARE_READ |<br>> FILE_SHARE_WRITE, NULL, dwCreationDisposition, dwFlagsAndAttributes,
<br>> NULL );<br> ><br>> which makes hFile equal to INVALID_HANDLE_VALUE (By this reason, the<br>> Open method returns NULL).<br><br>You might want to copy some error reporting code similar to what is<br>in the ::Seek() method (ifdef'ed out) into the ::Open() method in
<br>an attempt to see what errors windows is encountering. Really the<br>cpl_vsil_win32.cpp code should be querying win32 errors, and attempting<br>to translate them into corresponding settings of the errno global so that
<br>higher up functions can try and report the errors.<br><br>I will file a bug against GDAL about this, though it won't solve your<br>problem. At best it would help diagnose it more easily.<br><br>I suspect the file creation is failing either:
<br> o Because your failing case has different permissions.<br> o In your failing case the file already exists and is held open by something<br> so it cannot be overwritten/replaced.<br><br>Best regards,<br>--<br>---------------------------------------+--------------------------------------
<br>I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">warmerdam@pobox.com</a><br>light and sound - activate the windows |
<a href="http://pobox.com/%7Ewarmerdam" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://pobox.com/~warmerdam
</a><br>and watch the world go round - Rush | President OSGeo, <a href="http://osgeo.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://osgeo.org</a><br><br></blockquote></div><br><br>