Thanks!!

De: Even Rouault <even.roua...@spatialys.com>
Enviado el: dijous, 14 de desembre de 2023 18:00
Para: Abel Pau <a....@creaf.uab.cat>; gdal-dev@lists.osgeo.org
Asunto: Re: [gdal-dev] Why Open() inside QuietDelete()?



Le 14/12/2023 à 17:36, Abel Pau via gdal-dev a écrit :
Hi, today I have a very inside-code question...
I’m wondering why when I want to translate from .SHP to MiraMonFile (.PNT) and 
the destinatination file already exists I seems that the call stack reveals a 
way that is weird for me and I would like to understand:

Translate->Create->(then, as it extist) QuietDelete ->Detele ->Open.... (why 
Open if I have to delete?)

The answer lies in the code: 
https://github.com/OSGeo/gdal/blob/master/gcore/gdaldriver.cpp#L1642

The default Delete() implementation needs to know the file list composing the 
dataset (for example shapefile datasets are made of multiple files) by calling 
GDALDataset::GetFileList()

An alternative is that your driver implements the GDALDriver::pfnDelete 
callback, but I would do that only if the Open() in your driver is particularly 
slow (most drivers have a fast Open() method)

--

http://www.spatialys.com

My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to