#!/bin/perl
# $Id$

import os, sys
from stat import *

def walktree(dir, callback):
    '''recursively descend the directory rooted at dir,
       calling the callback function for each regular file'''

	print dir
    for f in os.listdir(dir):
        pathname = '%s/%s' % (dir, f)
        mode = os.stat(pathname)[ST_MODE]
        if S_ISDIR(mode):
            # It's a directory, recurse into it
            walktree(pathname, callback)
        elif S_ISREG(mode):
            # It's a file, call the callback function
            callback(pathname)
        else:
            # Unknown file type, print a message
            print 'Skipping %s' % pathname

def visitfile(file):
	print file
	
if __name__ == '__main__':
    walktree(sys.argv[1], visitfile)

	


Switch license from LGPL to ASL.
Switch license from LGPL to ASL.


git-svn-id: 1006245cb1bdea2fd4c9095e50bc2ef3d167b18c@243048 13f79535-47bb-0310-9956-ffa450edef68
