nom 0.3.10

A byte oriented, zero copy, parser combinators library
Documentation
diff --git a/src/producer.rs b/src/producer.rs
index 7ca49ff..b99a3bf 100644
--- a/src/producer.rs
+++ b/src/producer.rs
@@ -29,9 +29,12 @@
 
 use internal::*;
 use self::ProducerState::*;
+use util::*;
 
-use std::old_io::fs::File;
-use std::old_io::{IoResult, IoErrorKind};
+use std::fs::File;
+use std::path::Path;
+use std::io;
+use std::io::{Read,Error,ErrorKind,Seek,SeekFrom};
 
 
 /// Holds the data producer's current state
@@ -67,8 +70,10 @@ pub struct FileProducer {
 }
 
 impl FileProducer {
-  pub fn new(filename: &str, buffer_size: usize) -> IoResult<FileProducer> {
-    File::open(&Path::new(filename)).map(|f| {
+  pub fn new(filename: &str, buffer_size: usize) -> io::Result<FileProducer> {
+    File::open(&Path::new(filename)).map(|mut f| {
+      //f.seek(SeekFrom::Start(0));
+      println!("file opened: {} (buffer size: {})", filename, buffer_size);
       FileProducer {size: buffer_size, file: f, v: Vec::with_capacity(buffer_size)}
     })
   }
@@ -78,17 +83,22 @@ impl Producer for FileProducer {
   fn produce(&mut self) -> ProducerState<&[u8]> {
     //let mut v = Vec::with_capacity(self.size);
     self.v.clear();
-    match self.file.push(self.size, &mut self.v) {
+    match self.file.read(&mut self.v) {
       Err(e) => {
-        match e.kind {
-          IoErrorKind::NoProgress => Continue,
-          IoErrorKind::EndOfFile  => Eof(&self.v[]),
+        println!("error: {:?}", e);
+        match e.kind() {
+          //ErrorKind::NoProgress => Continue,
+          //ErrorKind::EndOfFile  => Eof(&self.v[]),
           _          => ProducerError(0)
         }
       },
-      Ok(_)  => {
-        //println!("read: {:?}\nbytes:\n{}", i, (&self.v).to_hex(8));
-        Data(&self.v[])
+      Ok(n)  => {
+        println!("read: {} bytes\ndata:\n{}", n, (&self.v).to_hex(8));
+        if n == 0 {
+          Eof(&self.v[])
+        } else {
+          Data(&self.v[])
+        }
       }
     }
   }