[Pythonmac-SIG] Calling diff from MacPython

Ryan Wilcox ryanwilcox@mac.com
Fri, 13 Sep 2002 15:48:09 -0400


On Friday, September 13, 2002, at 11:40 AM, Robin Siebler wrote:

>I need to compare to files and find out where they are different. 
>Using diff seems to be a much better/faster choice compared to using
>cmp().  How would I call the *nix command diff from MacPython?  The
>MacPython version of os has no system() call. 


If you can control your environment, you might consider using BBEdit's
Compare Files. It's only "ok" -- but it's pretty easy to figure out if
two files are different. (It however, will NOT tell you how MANY
differences WERE found via the scripting interface)

Don't know if it's faster then cmp() though. And I don't think there's
a built-in BBEdit python module -- you'd have to wrap a lot of it
yourself.

---------------
HOLD THE TRAIN....

You also might be able to use the "do shell script" osax to do this..
wrapping this into SYSTEM, I think, would be pretty simple.

On OS 9, doesn't system() call MPW? (I thought I saw that somewhere)

If I get a chance this weekend, I can investigate this...

Have a good holiday, Jack.
-Ryan Wilcox
----------------
PGP: 0x2F4E9C31
----------------