<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_quote">On Tue, Aug 16, 2011 at 4:46 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org">guido@python.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
</div>So what's the use case? In general when using a command line<br>
environment overwriting the file is what you *want* to happen. Like<br>
with Unix "foo >bar". I don't even think there *is* a shell syntax for<br>
not overwriting an existing file, though you can use >> to append<br>
instead of overwrite -- this is open(filename, 'a').<br></blockquote><div><br></div><div>We weren't just discussing command line tools. That said, I'm sure I'm not the only person on this list who has inadvertently overwritten a file using foo > bar. While we may have grown accustomed to this behavior and some people (like you) may even consider it desirable, not everyone does.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
> I've had enough working with programs that do things like silently eat<br>
> exceptions and I consider silently overwriting a file in the same class.<br>
<br>
</div>Always? How would you update an existing file if you can't overwrite files?<br></blockquote><div><br></div><div>I didn't say never overwrite. What I don't like is programs overwriting files without explicitly intending to do that.</div>
<div><br></div><div>Yes, there's a long legacy of overwriting files without warning or intent. I suppose I'm fighting an uphill battle (and it's not my highest priority complaint about bad code for that matter).</div>
</div><div><br clear="all"><font face="arial, helvetica, sans-serif">--- Bruce</font><div><font face="arial, helvetica, sans-serif">Follow me: <a href="http://www.twitter.com/Vroo" target="_blank">http://www.twitter.com/Vroo</a> <a href="http://www.vroospeak.com/" target="_blank">http://www.vroospeak.com</a></font></div>
</div><div><br></div>