On 5/20/06, Leslie Viljoen <leslieviljoen / gmail.com> wrote:
> On 5/20/06, Leslie Viljoen <leslieviljoen / gmail.com> wrote:
> > On 5/19/06, Leslie Viljoen <leslieviljoen / gmail.com> wrote:
> >
> > > So much for platform Independence! I have tried to contact Brian
> > > without success and now I'm running out of time.
> > >
> > > Any suggestions?
> >
> > Gonzalo sent me a ported suffix array and the tests and it all works
> > very well - although Gdiff still produces broken files. I am going to
> > go through it and try to debug it.
> >
> > Is there some difference between how Ruby handles binary files on
> > Windows and on Linux? Could it be ios.binmode? I am going to give it a
> > try...
>
> Working better now... the patch files are very similar...
>


Problem solved! I had to set binmode on all three files in question:

require "gdiff"

source = File.new(ARGV[0])
source.binmode

target = File.new(ARGV[1])
target.binmode

$stdout.binmode

puts Diff::GDiff.diff(source.read, target.read).pack

/\/\/\/\/\/\/\

Sorry for the running soap-opera-like updates, but it sure was
exciting wasn't it!?
If anyone needs GDiff/GPatch to run on Windows they can send me an email
and I'll give them the full run-down.

Les