<div dir="ltr">This may be too much on the Unix side of thought, but could pdal catch a signal and clean up the output file. That puts it on the user to interrupt using the right signal to the process and wouldn't require a copy. <div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">Kirk Waters, PhD, BJCP | NOAA Office for Coastal Management<br></font></div><div><font face="arial, helvetica, sans-serif">Applied Sciences Program | 2234 South Hobson Ave<br>843-740-1227 (empty office) | Charleston, SC 29405</font></div><div><font face="arial, helvetica, sans-serif">843-324-2203 (cell during COVID) </font><div><font face="arial, helvetica, sans-serif"><a href="http://coast.noaa.gov/digitalcoast" target="_blank">coast.noaa.gov/digitalcoast</a></font><br></div></div><div><br></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 10, 2020 at 7:22 AM Andrew Bell <<a href="mailto:andrew.bell.ia@gmail.com">andrew.bell.ia@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div>My take on this is that it's expensive to write to a temporary file and then copy it. Some output files very are large. Since you, the user, are the one interrupting the process, it seems that it's up to you to clean up. This behavior is also consistent with most other programs.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 10, 2020 at 5:50 AM Peder Axensten <<a href="mailto:Peder.Axensten@slu.se" target="_blank">Peder.Axensten@slu.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
If pdal is interrupted while saving to the destination file, it might result in a corrupt file. This is not unreasonable, but could be avoided.<br>
<br>
We use a make script to process large amounts of files and sometimes we have to interrupt processing for different reasons. We then risk to have corrupt files that make will consider final when rerunning the script, so the files are left in a corrupt state.<br>
<br>
Would it be a good idea to make pdal by default save the contents to a temporary file and then move the temporary file to the destination file? This way either a correct file is produced or nothing. I'm implementing this in the make script – it is somewhat cumbersome but will work ok, I guess.<br>
<br>
Isn’t it a very attractive and useful guarantee: if the destination file is produced, then it is correct?<br>
<br>
Best regards,<br>
<br>
Peder Axensten<br>
Research engineer<br>
<br>
Remote Sensing<br>
Department of Forest Resource Management<br>
Swedish University of Agricultural Sciences<br>
SE-901 83 Umeå<br>
Visiting address: Skogsmarksgränd<br>
Phone: +46 90 786 85 00<br>
<a href="mailto:peder.axensten@slu.se" target="_blank">peder.axensten@slu.se</a>, <a href="http://www.slu.se/srh" rel="noreferrer" target="_blank">www.slu.se/srh</a><br>
<br>
The Department of Forest Resource Management is environmentally certified in accordance with ISO 14001.<br>
<br>
---<br>
När du skickar e-post till SLU så innebär detta att SLU behandlar dina personuppgifter. För att läsa mer om hur detta går till, klicka här <<a href="https://www.slu.se/om-slu/kontakta-slu/personuppgifter/" rel="noreferrer" target="_blank">https://www.slu.se/om-slu/kontakta-slu/personuppgifter/</a>><br>
E-mailing SLU will result in SLU processing your personal data. For more information on how this is done, click here <<a href="https://www.slu.se/en/about-slu/contact-slu/personal-data/" rel="noreferrer" target="_blank">https://www.slu.se/en/about-slu/contact-slu/personal-data/</a>><br>
_______________________________________________<br>
pdal mailing list<br>
<a href="mailto:pdal@lists.osgeo.org" target="_blank">pdal@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/pdal" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/pdal</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div>
_______________________________________________<br>
pdal mailing list<br>
<a href="mailto:pdal@lists.osgeo.org" target="_blank">pdal@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/pdal" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/pdal</a></blockquote></div>