Index: lib/bio/io/flatfile.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile.rb,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- lib/bio/io/flatfile.rb	3 Mar 2006 09:31:57 -0000	1.48
+++ lib/bio/io/flatfile.rb	22 Mar 2006 10:19:22 -0000	1.49
@@ -5,7 +5,7 @@
 #
 # License:: Ruby's
 #
-#  $Id: flatfile.rb,v 1.48 2006/03/03 09:31:57 ngoto Exp $
+#  $Id: flatfile.rb,v 1.49 2006/03/22 10:19:22 ngoto Exp $
 #
 #
 # Bio::FlatFile is a helper and wrapper class to read a biological data file.
@@ -261,6 +261,9 @@
         # the last entry read from the stream
         attr_reader :entry
 
+        # a flag to write down entry start and end positions
+        attr_accessor :entry_pos_flag
+
         # start position of the entry
         attr_reader :entry_start_pos
 
@@ -289,6 +292,7 @@
             end
           end
           @delimiter_overrun = klass::DELIMITER_OVERRUN rescue nil
+          @entry_pos_flag = nil
         end
 
         # (String) delimiter indicates the end of a entry.
@@ -329,7 +333,7 @@
 
         # gets a entry
         def get_entry
-          p0 = @stream.pos
+          p0 = @entry_pos_flag ? @stream.pos : nil
           e  = @stream.gets(@delimiter)
           if e and @delimiter_overrun then
             if e[-@delimiter.size, @delimiter.size ] == @delimiter then
@@ -338,7 +342,7 @@
               @stream.ungets(overrun)
             end
           end
-          p1 = @stream.pos
+          p1 = @entry_pos_flag ? @stream.pos : nil
           @entry_start_pos = p0
           @entry = e
           @entry_ended_pos = p1
@@ -586,6 +590,16 @@
       @splitter.entry
     end
 
+    # a flag to write down entry start and end positions
+    def entry_pos_flag
+      @splitter.entry_pos_flag
+    end
+
+    # Sets flag to write down entry start and end positions
+    def entry_pos_flag=(x)
+      @splitter.entry_pos_flag = x
+    end
+
     # start position of the last entry
     def entry_start_pos
       @splitter.entry_start_pos
Index: lib/bio/io/flatfile/indexer.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile/indexer.rb,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- lib/bio/io/flatfile/indexer.rb	22 Feb 2006 08:41:03 -0000	1.23
+++ lib/bio/io/flatfile/indexer.rb	22 Mar 2006 10:19:22 -0000	1.24
@@ -4,7 +4,7 @@
 # Copyright:: Copyright (C) 2002 GOTO Naohisa <ng@bioruby.org> 
 # License::   Ruby's
 # 
-#  $Id: indexer.rb,v 1.23 2006/02/22 08:41:03 ngoto Exp $ 
+#  $Id: indexer.rb,v 1.24 2006/03/22 10:19:22 ngoto Exp $ 
 # 
 
 require 'bio/io/flatfile/index'
@@ -114,6 +114,7 @@
             DEBUG.print "fileid=#{fileid} file=#{@flatfilename.inspect}\n"
             @flatfile = Bio::FlatFile.open(@dbclass, file, 'rb')
             @flatfile.raw = nil
+            @flatfile.entry_pos_flag = true
             @entry = nil
           end
           attr_reader :fileid
