[gdal-dev] Problems creating a VSI File on Windows

Roberto Ribeiro robertofig85 at gmail.com
Thu Sep 26 06:44:21 PDT 2019

Hello list,

I am trying to create a VSI File on Memory, in a W10 system, but am unsure
how to proceed with path style.

> VSIFILE* Mem = VSIFileFromMemBuffer("path", (GByte*) NewImg,
(vsi_l_offset) (XSize * YSize), FALSE);
> GDALDataset* DS = (GDALDataset*) GDALOpen("path", GA_ReadOnly);

When doing the traditional Windows backslashes ("\\vsimem\\file.tif") it
raises the following error when run: "'\vsimem\file.tif' does not exist in
the file system, and is not recognized as a supported dataset name."

I scooped around some and found a ticket from a decade ago (
https://trac.osgeo.org/gdal/ticket/2318) saying I should use the Unix
format ("/vsimem/file.tif"), but when doing so it raises:
"'/vsimem/file.tif' not recognized as a supported file format.".

What is the proper way of doing this on Windows?

P.S.: linking to GDAL 2.0.3 64-bits, compiling with VS2017.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190926/59c0c9bc/attachment.html>

More information about the gdal-dev mailing list