Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## treewalker.py v0.2
- import os
- from os.path import join, getsize
- # Set this to where you want the crawler to begin
- rootdir="/Users/kermit/Desktop"
- # This is where we copy the files
- dstdir="/evidence"
- # This is the file we're looking for
- targetfile="index"
- counter = 0
- def processFile(fullpath,filename):
- global counter
- if filename == targetfile:
- newname = targetfile + str(counter)
- os.system("echo cp " + fullpath + " " + join(dstdir,newname))
- counter = counter + 1
- for root, dirs, files in os.walk(rootdir):
- for name in files:
- processFile(join(root, name),name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement