Navigation Menu

Skip to content

Commit

Permalink
Create composite file archives in new_file_path instead of TMP
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Oct 17, 2018
1 parent a8fa5a1 commit 126ee5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/datatypes/data.py
Expand Up @@ -247,7 +247,7 @@ def _archive_composite_dataset(self, trans, data=None, **kwd):
try:
if params.do_action == 'zip':
# Can't use mkstemp - the file must not exist first
tmpd = tempfile.mkdtemp()
tmpd = tempfile.mkdtemp(dir=trans.app.config.new_file_path, prefix='gx_composite_archive_')
util.umask_fix_perms(tmpd, trans.app.config.umask, 0o777, trans.app.config.gid)
tmpf = os.path.join(tmpd, 'library_download.' + params.do_action)
archive = zipfile.ZipFile(tmpf, 'w', zipfile.ZIP_DEFLATED, True)
Expand Down Expand Up @@ -361,7 +361,7 @@ def display_data(self, trans, data, preview=False, filename=None, to_ext=None, *
file_path = trans.app.object_store.get_filename(data.dataset, extra_dir='dataset_%s_files' % data.dataset.id, alt_name=filename)
if os.path.exists(file_path):
if os.path.isdir(file_path):
with tempfile.NamedTemporaryFile(delete=False) as tmp_fh:
with tempfile.NamedTemporaryFile(delete=False, dir=trans.app.config.new_file_path, prefix='gx_html_autocreate_') as tmp_fh:
tmp_file_name = tmp_fh.name
dir_items = sorted(os.listdir(file_path))
base_path, item_name = os.path.split(file_path)
Expand Down

0 comments on commit 126ee5f

Please sign in to comment.