Skip to content

Instantly share code, notes, and snippets.

View elee's full-sized avatar

Eric Lee elee

View GitHub Profile
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:
import os
coredir = "/etc/sv/core"
histfile = "/tmp/corehist.txt"
dirlist = os.listdir(coredir)
dirlist.remove("core")
dirlist.count
with open(histfile, 'w') as f:
value_in_file = f.readline()