<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 14/12/2023 à 17:36, Abel Pau via
gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:PAXPR07MB7775DB27C5D8600AF6B0CE28A28CA@PAXPR07MB7775.eurprd07.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator"
content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}span.EstiloCorreo17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi, today I have a very
inside-code question...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Translate->Create->(then,
as it extist) QuietDelete ->Detele ->Open....
<b>(why Open if I have to delete?)</b></span></p>
</div>
</blockquote>
<p>The answer lies in the code:
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/master/gcore/gdaldriver.cpp#L1642">https://github.com/OSGeo/gdal/blob/master/gcore/gdaldriver.cpp#L1642</a></p>
<p>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()<br>
</p>
<p>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)<br>
</p>
<span style="white-space: pre-wrap">
</span>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>