Skip to content

Commit

Permalink
Added a check to limit the length of the tmpdir
Browse files Browse the repository at this point in the history
  • Loading branch information
genomewalker committed Apr 30, 2024
1 parent b78d14d commit b14e13b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bam_filter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def check_tmp_dir_exists(tmpdir):
log.error(f"Temporary directory {tmpdir} does not exist")
exit(1)
tmpdir = tempfile.TemporaryDirectory(dir=os.path.abspath(tmpdir))
# Check if tmpdir has more than 107 characters
if len(tmpdir.name) > 107:
log.error(f"Temporary directory {tmpdir.name} has more than 107 characters")
exit(1)
return tmpdir


Expand Down

0 comments on commit b14e13b

Please sign in to comment.