From: Earle Clubb Date: 2007-10-23T23:58:30+09:00 Subject: How to search for ascii char sequence in binary file So I'm trying to convert e.g. 'RIFF' to e.g. '52494646'. What's the best way to do that? I don't know what the former string will be, be I know it will be exactly four characters. I'm searching a binary file for the latter string, but I'm given the former as the search term. I'm thinking something like this for the search: puts File.read('file.wav').index('52494646') So... best way to do the conversion, and best way to do the search. Ideas? Earle -- Posted via http://www.ruby-forum.com/.