title: Delete directories older than X days?
body: <p>I decided to go python for this because I am in the process of learning Python, so I use it over Powershell whenever I can.</p>
  
  <p>I have the theory down for this, but it seems <code>os.stat</code> cannot take a list, but only a string or <code>int</code>.  Right now I'm just printing before I go and delete things.</p>
  
  <pre><code>import os
  import time
  
  path = "\\\\path\\to\\videoroot\\"
  now = time.time()
  old = now - 1296000
  
  for root, dirs, files in os.walk(path, topdown=False):
      if time.ctime(os.path.getmtime(dirs) &lt; old:
          print (dirs)
  </code></pre>
  
  <p>Output/error message:</p>
  
  <pre class="lang-none prettyprint-override"><code>return os.stat(filename).st_mtime
      TypeError: argument should be string, bytes or integer, not list
  </code></pre>