[TxMt] little-endian, ruby, and run script

Albert Vernon Smith smithav at cshl.edu
Mon Mar 13 13:19:46 UTC 2006


I am writing a script to parse a binary file in ruby.  According to  
the documentation on the file format, the integers are in little- 
endian format.  When I take the script, read the appropriate part of  
the file, then 'unpack' with 'V' (little-endian), I don't get the  
right answer from the internal "Run script" command.  I do get the  
right answer if I change to unpack with 'N'.  However, if run from  
the command line against Apple Ruby (/usr/bin/ruby 1.8.2) or against  
Ruby compiled with DarwinPorts (/opt/local/bin/ruby 1.8.4), I get the  
appropriate result with 'V' (as I should).

This seems to be a bug to me, though I'm not sure I'm missing  
something here.  Can someone either confirm this is a bug, or  
alternatively explain to me why things are behaving in this way.

-albert



More information about the textmate mailing list