<div dir="ltr">I'll second this one. Something I've been thinking about asking for for a while. Only reason I can think of against it is that adding a second line to call <font face="monospace, monospace">system( "rm file")</font> makes it a little harder to accidentally delete a file. So my thinking was to make Cathy's "cw" the default for "c". That way it will add to the file if it exists and is the same size, but it'll give you an error if you try to write something that doesn't fit in that file.<div><br></div><div> Carl</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 9, 2015 at 8:09 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Cathy,<br><br></div>I have opened a JIRA ticket: NCL-2230<br><br></div><div>THX<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">D<br><div><br><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 8, 2015 at 2:31 PM, Cathy Smith (NOAA Affiliate) <span dir="ltr"><<a href="mailto:cathy.smith@noaa.gov" target="_blank">cathy.smith@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">NCL staff<br>
I've run into an issue a bunch of times where I was running code that<br>
creates a new netCDF file. If I'm debugging or if I have updated data<br>
which goes into the file, when I open a file with status value "c", the<br>
code fails as the file already exists. If the file doesn't exist yet,<br>
then I can't use "w" as a new file needs to be created. I can write<br>
something where I test for the file and if it exists, I can decide to<br>
delete the old copy first or write to the old file but it seems kludgy.<br>
I can of course delete the old file first when using "c" before running<br>
the code but sometimes I forget and sometimes someone else runs the code<br>
and gets a permission error which they don't understand.<br>
<br>
I was wondering if it would be useful to have 2 new status flags to<br>
addfile(s). Maybe "cd" and "cw". The first would check for the file<br>
first and delete it if it already existed and then open the new file.<br>
The second would open the file with a "w" if it already existed. These<br>
would act more like C or Fortran flags. If a user was worried about<br>
accidentily deleting or writing to old files, they could still use "c".<br>
<br>
It's just a suggestion and there could be issues I am not considering,<br>
of course.<br>
<br>
Cathy<br>
<br>
--<br>
----------------------------------------------<br>
NOAA/ESRL PSD and CU CIRES<br>
<a href="tel:303-497-6263" value="+13034976263" target="_blank">303-497-6263</a><br>
<a href="http://www.esrl.noaa.gov/psd/people/cathy.smith/" target="_blank">http://www.esrl.noaa.gov/psd/people/cathy.smith/</a><br>
<br>
Emails about data/webpages may get quicker responses from emailing<br>
<a href="mailto:esrl.psd.data@noaa.gov" target="_blank">esrl.psd.data@noaa.gov</a><br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br><table border="0" cellpadding="2" cellspacing="2" style="max-width:100%;border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-size:14px;border:3px solid rgb(170,170,170);font-family:Times;line-height:12px;background-color:transparent"><tbody><tr><td align="center" height="71" width="71"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><a href="http://www.cicsnc.org/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank"><img src="http://www.cicsnc.org/assets/images/cicsnc-logo.png" width="96" height="93"></a> <a href="http://www.researcherid.com/rid/B-8711-2011" target="_blank"><br></a></span></span><br><font size="4"><b style="text-align:start;color:rgb(38,58,143);font-family:arial,helvetica,sans-serif"> <a href="http://www.cyclonecenter.org/" style="color:rgb(38,58,143);text-decoration:none" target="_blank">Cyclone</a></b><a href="http://www.cyclonecenter.org/" style="text-align:start;color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;text-decoration:none" target="_blank">Center.org</a> </font></td><td valign="top"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><b>Carl J. Schreck III, PhD</b><br><b>Research Associate</b><br></span></span><a href="http://www.cicsnc.org/" style="font-family:arial,helvetica,sans-serif;font-size:11px;color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">Cooperative Institute for Climate and Satellites NC (CICS-NC)</a> /<br><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif"><a href="http://www.cicsnc.org/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">North Carolina Institute for Climate Studies (NCICS)</a> <br><a href="http://ncsu.edu/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">North Carolina State University</a><br><a href="http://ncei.noaa.gov/" style="color:rgb(38,58,143);text-decoration:none;font-weight:bold" target="_blank">NOAA National Centers for Environmental Information (NCEI)</a><br>151 Patton Ave, Asheville, NC 28801<br>e: </span></span><a href="mailto:cjschrec@ncsu.edu" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">cjschrec@ncsu.edu</a><br style="font-family:arial,helvetica,sans-serif;font-size:11px"><span style="font-size:11px"><span style="font-family:arial,helvetica,sans-serif">o: +1 828 257 3140<br></span></span><a href="http://scholar.google.com/citations?hl=en&user=th8ONEcAAAAJ&view_op=list_works&sortby=pubdate" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">Publications</a><br><a href="http://monitor.cicsnc.org/mjo/" style="color:rgb(38,58,143);font-family:arial,helvetica,sans-serif;font-size:11px;text-decoration:none;font-weight:bold" target="_blank">monitor.cicsnc.org/mjo</a><br style="font-family:arial,helvetica,sans-serif;font-size:11px"></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div>
</div>