def readchunks(path, chunksize=1048576)
      open(path) { |source|
        size = source.length
        index = 0
        while index < size
          yield source.read(index, chunksize)
          index += chunksize
        end
      }
    end
def readchunks(path, chunksize=1048576)
      open(path) { |source|
        size = source.length
        index = 0
        while index < size
          yield source.read(index, chunksize)
          index += chunksize
        end
      }
    end
yeild chunksize of path one chunk at a time