Forum: Ruby Showing file position with FasterCSV

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
sa 1. (Guest)
on 2008-11-27 12:59
Hi -

I'm trying to get the file position with FasterCSV to show progress:

csv = FasterCSV.open(path_to_file, "r")
file_size = File.size(path_to_file)

for row in csv
  position = csv.tell # this only returns 0...

  # do stuff...

end

I only get 0 using csv.tell or csv.pos -- any idea what I'm doing wrong
or how to accomplish what I'm trying to?

Thanks!
sa 1. (Guest)
on 2008-11-27 14:26
This ends up working, my bad.
This topic is locked and can not be replied to.