title: get file size of the file from the file object
body: <p>I need to know the size of the file based on file object</p>
  
  <pre><code>import csv
  import os
  with open("test.csv", "rb") as infile:
      reader = csv.reader(infile)
      print reader
      filesize(reader)
  def filesize(reader):
      os.getsize(reader) #And i need work with reader for more details.so I must need to pass a reader or file object
  </code></pre>
  
  <p>When I run  this I got an output is </p>
  
  <pre><code>&lt;_csv.reader object at 0x7f5644584980&gt;
  </code></pre>
  
  <p>From this file object how I get the size of the file?</p>
  
  <p>And I checked this site but these are not CSV attribute <a href="https://stackoverflow.com/questions/283707/size-of-an-open-file-object">size of an open file object</a></p>
  
  <p><strong>EDIT:</strong> When I use that two inbuilt function I got errors that are </p>
  
  <blockquote>
    <p>AttributeError: '_csv.reader' object has no attribute 'seek'
    AttributeError: '_csv.reader' object has no attribute 'tell'</p>
  </blockquote>