Skip to content

Instantly share code, notes, and snippets.

@cwjohnston
Forked from elee/babylon
Created June 8, 2011 19:35
Show Gist options
  • Save cwjohnston/1015174 to your computer and use it in GitHub Desktop.
Save cwjohnston/1015174 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)
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