-
-
Save cwjohnston/1015174 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cwj@sparkplug % python corecheck.py ~/Dropbox/Needle/corecheck | |
File "corecheck.py", line 13 | |
f.writeline(dirlist.count) | |
^ | |
SyntaxError: invalid syntax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment