|
Ruby for Windows Problems - BUG??: msg#01091lang.ruby.general
the following routine... def readindex(path) puts path index = [] if File.exists?(path) then happy = File.open(path) while true break if happy.eof raw = happy.read(5) bytes = [] raw.each_byte {|c| bytes.push(c)} bytes.reverse! n = 0 bytes.each {|i| n = n*256+i } shift=24-((n>>24) & 0x7f) n=(n & 0x00ffffff) | 0x00800000 index.push((n >>shift)-1) end return index else puts "NDX File not found." end end works correctly in Linux version... 1.6.4 and in cgi-win version 1.6.5 but NOT in ruby 1.6.7 (2002-03-01) [i586-mswin32] in 1.6.7 for mswin32 it doesn't return all the data, instead ending with a -1 somewhere in the middle. I think I am going to have to dump developing apps for both the windows and linux versions, as there are too many inexplicable differences. Ideas? Thanks, Mark NOTICE: This e-mail and any attachment(s) may contain confidential and proprietary information of Goss International Corporation and/or its subsidiaries and may be legally privileged. This e-mail is intended solely for the addressee. If you are not the addressee, dissemination, copying or other use of this e-mail or any of its content is strictly prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail and any copies. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender. No contract may be construed by this e-mail.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Fun with shifting bytes / Python translation, Firestone, Mark - Technical Support |
|---|---|
| Next by Date: | Re: Ruby Language Q's, ts |
| Previous by Thread: | Primary Key Hash help, Chris Morris |
| Next by Thread: | Re: Ruby for Windows Problems - BUG??, Andrew Hunt |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |