...
Code Block | ||||
---|---|---|---|---|
| ||||
def create_word_count(inputfile, ext, host, fileid): global logger (fd, wcfileinputfile)=tempfile.mkstemp(suffix='.' + ext) try: # make syscall to wc subprocess.check_output(['wc', inputfile], stderr=subprocess.STDOUT) if(os.path.getsize(wcfile) == 0): raise Exception("File is empty.") # upload word count file |
...