title: Get file size, creation date and modification date in Python
body: <p>I need to get file info (path, size, dates, etc) and save it in a txt but I don't know where or how to do it.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>ruta = "FolderPath"
  os.listdir(path=ruta)
  miArchivo = open("TxtPath","w")
  def getListOfFiles(ruta):
   listOfFile = os.listdir(ruta)
   allFiles = list()
   for entry in listOfFile:
    fullPath = os.path.join(ruta, entry)
    if os.path.isdir(fullPath):
     allFiles = allFiles + getListOfFiles(fullPath)
    else:
     allFiles.append(fullPath)
   return allFiles
  
  listOfFiles = getListOfFiles(ruta)
  for elem in listOfFiles:
   print(elem)
   print("\n")
   miArchivo.write("%s\n" % (elem))
  miArchivo.close()
  </code></pre>
  
  <p>The output is (only path, no other info):
  <a href="https://i.stack.imgur.com/0frwA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0frwA.png" alt="enter image description here"></a></p>
  
  <p>What I want is:
  V:\1111111\222222222\333333333\444444444\5555555555\66666666\Folder\File name -- size -- modification date and so on</p>