[Gdal-dev] Strange error during Driver.Create(String filename,
...)
Daniele Romagnoli
dany.geotools at gmail.com
Tue Jan 9 15:51:08 EST 2007
Thank you Frank.
I will investigate more deeply using your suggestion.
Just a simple question:
what do you think about the strange "filename" behaviour? (A file named
"D:\\blabla.ext" works while "D:\\myFolder\\blabla.ext" does not)
Thanks a lot.
Best regards,
Daniele
On 1/9/07, Frank Warmerdam < warmerdam at pobox.com> wrote:
>
> Daniele Romagnoli wrote:
> > However, using the SAME code within the body of the "write" method of
> > the MyJP2KImageWriter class (which extends ImageWriter), it does not
> work.
> > (Such a method will be called during an ImageWrite operation performed
> > using JAI-ImageIO toolkit).
>
> Daniele,
>
> I'm afraid I am unclear of the differences between the standalone JUnit
> test, and the MyJP2KImageWriter case. Is, by any chance, the second
> running
> as a web service with different permissions than when run directly by you
> under your user account?
>
> > containing the code
> >
> > hFile = CreateFile( pszFilename, dwDesiredAccess, FILE_SHARE_READ |
> > FILE_SHARE_WRITE, NULL, dwCreationDisposition, dwFlagsAndAttributes,
> > NULL );
> >
> > which makes hFile equal to INVALID_HANDLE_VALUE (By this reason, the
> > Open method returns NULL).
>
> You might want to copy some error reporting code similar to what is
> in the ::Seek() method (ifdef'ed out) into the ::Open() method in
> an attempt to see what errors windows is encountering. Really the
> cpl_vsil_win32.cpp code should be querying win32 errors, and attempting
> to translate them into corresponding settings of the errno global so that
> higher up functions can try and report the errors.
>
> I will file a bug against GDAL about this, though it won't solve your
> problem. At best it would help diagnose it more easily.
>
> I suspect the file creation is failing either:
> o Because your failing case has different permissions.
> o In your failing case the file already exists and is held open by
> something
> so it cannot be overwritten/replaced.
>
> Best regards,
> --
> ---------------------------------------+--------------------------------------
>
> I set the clouds in motion - turn up | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> <http://pobox.com/%7Ewarmerdam>
> and watch the world go round - Rush | President OSGeo, http://osgeo.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070109/85f68d15/attachment.html
More information about the Gdal-dev
mailing list