Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. from mmap import mmap, ACCESS_READ
  2. import contextlib
  3. from os import path
  4. from shutil import move
  5.  
  6. for filename in glob.iglob('*.txt'):
  7.     with open(filename) as f:
  8.         with contextlib.closing(mmap.mmap(f.fileno(), 0, access=ACCESS_READ)) as s:
  9.             if s.find('* Test Outcome : FAIL') != -1:
  10.                 src_file = path.join(dirSTART, filename)
  11.                 dst_file = path.join(dirFAIL, filename)
  12.                 move(src_file, dst_file + filename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement