Skip to content

Instantly share code, notes, and snippets.

@elee
Forked from cwjohnston/babylon.py
Created June 8, 2011 19:39
Show Gist options
  • Save elee/1015185 to your computer and use it in GitHub Desktop.
Save elee/1015185 to your computer and use it in GitHub Desktop.
import fnmatch
import os
coredir = "/Users/cwj/Dropbox/Needle/corecheck/test"
histfile = "/Users/cwj/Dropbox/Needle/corecheck/corehist.txt"
cores = [file for file in os.listdir(coredir) if fnmatch.fnmatch(file, 'core.*')]
if os.path.exists(histfile):
with open(histfile, 'w') as f:
value_in_file = f.readline()
if value_in_file == '' or int(value_in_file) != cores.count:
f.writeline(dirlist.count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment