Skip to content

Commit

Permalink
Ensure tmp dir exists for --no-stream
Browse files Browse the repository at this point in the history
Closes #48
  • Loading branch information
johnlees committed Jul 7, 2019
1 parent 1ff2903 commit 4408246
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PopPUNK/mash.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,12 @@ def queryDatabase(qFile, klist, dbPrefix, queryPrefix, self = True, number_plot_
mash_cmd = mash_exec + " dist -p " + str(threads) + " " + ref_dbname + " " + query_dbname

if no_stream:
tmpDirName = "./" + os.path.basename(dbPrefix)
if not os.path.isdir(tmpDirName):
tmpDirName = None

tmpHandle, tmpName = mkstemp(prefix=os.path.basename(dbPrefix),
suffix=".tmp", dir="./" + os.path.basename(dbPrefix))
suffix=".tmp", dir=tmpDirName)
mash_cmd += " > " + tmpName
mash_cmd += " 2> " + os.path.basename(dbPrefix) + ".err.log"
sys.stderr.write(mash_cmd + "\n")
Expand Down

0 comments on commit 4408246

Please sign in to comment.