Re: Exception thrown while trying to read file

2014-10-03 Thread thedeemon via Digitalmars-d-learn
On Friday, 3 October 2014 at 11:30:02 UTC, Matt wrote: I am building a PE-COFF file reader file.seek(0x3c, SEEK_SET); file.readf(%d, offs); // this is the problem line Does anyone else see whatever it is that I'm doing wrong? readf is for reading text, it expects to see some digits. You're

Re: Exception thrown while trying to read file

2014-10-03 Thread Matt via Digitalmars-d-learn
On Friday, 3 October 2014 at 13:48:41 UTC, thedeemon wrote: On Friday, 3 October 2014 at 11:30:02 UTC, Matt wrote: I am building a PE-COFF file reader file.seek(0x3c, SEEK_SET); file.readf(%d, offs); // this is the problem line Does anyone else see whatever it is that I'm doing wrong? readf

Re: Exception thrown while trying to read file

2014-10-03 Thread ketmar via Digitalmars-d-learn
On Fri, 03 Oct 2014 14:19:23 + Matt via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: also you can use my iv.io module to reading binary numbers: http://repo.or.cz/w/iv.d.git/blob_plain/HEAD:/io.d like this: auto offs = file.readNum!uint(); this is endian-safe too (in the