title: Python get recent files FTP
body: <p>I need to get the newest files/directory on my FTP server (updated today), I've discovered this solution: </p>
  
  <pre><code>def callback(line):
      try:
          #only use this code if you'll be dealing with that FTP server alone
          #look into dateutil module which parses dates with more flexibility
          when = datetime.strptime(re.search('[A-z]{3}\s+\d{1,2}\s\d{1,2}:\d{2}', line).group(0),     "%b %d %H:%M")
          today = datetime.today()
          if when.day == today.day and when.month == today.month:
              pass
              print "Updated file"
              #####THE CODE HERE#######
      except:
          print "failed to parse"
          return
  
  ftp.retrlines('LIST', callback)
  </code></pre>
  
  <p>BUT: With this code, I only get multiples "failed to parse" and also multiples "Updated file"-prints. But I need the file/directory name of the file/directory updated today. What is the code to paste in the "#####THE CODE HERE#######"-part to get the directoryname?</p>