title: With python, How to read the "date created" of a file?
body: <p>I am writing a short script in python that will scan through a list of folders for image files and then re-organize them.</p>
  
  <p>One of the optional way of organizing them i wish to have is by the date they are created.</p>
  
  <p>Currently, I am trying to read the image creation date as follows</p>
  
  <pre><code>import os.path, time
  
  f = open("hi.jpg")
  data = f.read()
  f.close()
  print "last modified: %s" % time.ctime(os.path.getmtime(f))
  print "created: %s" % time.ctime(os.path.getctime(f))
  </code></pre>
  
  <p>But I get an error that reads</p>
  
  <pre><code>Traceback (most recent call last):
    File "TestEXIFread.py", line 6, in &lt;module&gt;
      print "last modified: %s" % time.ctime(os.path.getmtime(f))
    File "/usr/lib/python2.7/genericpath.py", line 54, in getmtime
      return os.stat(filename).st_mtime
  TypeError: coercing to Unicode: need string or buffer, file found
  </code></pre>
  
  <p>Can anyone tell me what it means?</p>