Find files that have been changed recursively
<p>I am attempting to write a simple script to recursively rip through a directory and check if any of the files have been changed. I only have the traversal so far:</p>

<pre><code>import fnmatch
import os 
from optparse import OptionParser

rootPath = os.getcwd() 
pattern = '*.js' 

for root, dirs, files in os.walk(rootPath):    
    for filename in files:        
        print( os.path.join(root, filename))
</code></pre>

<p>I have two issues:</p>

<p><strong>1. How do I tell if a file has been modified?</strong></p>

<p><strong>2. How can I check if a directory has been modified?</strong> - I need to do this because the folder I wish to traverse is <em>huge</em>. If I can check if the dir has been modified and not recursively rip through an unchanged dir, this would <em>greatly</em> help. </p>

<p>Thanks!</p>
