<html><head/><body><html><head></head><body>1.The link I provided wasn't how I wanted it to be. I was using it as an example to show it wasn't impossible.<br>
2.You yourself stated it doesn't work on UTF-8 files. If you wanted one that worked on all text files, it wouldn't work right.<br>
3.Did no one get the 'nothingness/is/eternal' joke?<br>
<br>
So...although that is a nice piece of code, an os.path implementation would probably be more complete and foolproof.<br><br><div class="gmail_quote">Eli Bendersky <eliben@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr"><br /><div class="gmail_extra"><br /><br /><div class="gmail_quote">On Wed, Jul 31, 2013 at 8:40 AM, Ryan <span dir="ltr"><<a href="mailto:rymg19@gmail.com" target="_blank">rymg19@gmail.com</a>></span> wrote:<br />

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Here's something more interesting than my shlex idea.<br />
<br />
os.path is, pretty much, the Python FS toolbox, along with shutil. But, there's one feature missing: check if a file is binary. It isn't hard, see <a href="http://code.activestate.com/recipes/173220" target="_blank">http://code.activestate.com/recipes/173220</a>/. But, writing 50 lines of code for a more common task isn't really Python-ish.<br />


<br />
So...<br />
<br />
What if os.path had a binary checker that works just like isfile:<br />
os.path.isbinary('/nothingness/is/eternal') # Returns boolean<br /></div></blockquote></div><br /><br /></div><div class="gmail_extra">Some time ago I put on a gas mask and dove into the Perl source code to figure out how its "is binary" and "is text" operators work: <a href="http://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/">http://eli.thegreenplace.net/2011/10/19/perls-guess-if-file-is-text-or-binary-implemented-in-python/</a><br />

<br /></div><div class="gmail_extra">I would recommend against including such a simplistic heuristic in the Python stdlib. <br /><br /></div><div class="gmail_extra">Eli<br /><br /></div><div class="gmail_extra"><br /></div></div>
</blockquote></div></body></html><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</body></html>