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: |
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 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() |