# Cwltool: flag to disable download to local file system

**URL:** <https://cwl.discourse.group/t/cwltool-flag-to-disable-download-to-local-file-system/206>\
**Category:** CWL Questions\
**Created:** [September 19, 2020, 6:49am UTC](https://cwl.discourse.group/t/cwltool-flag-to-disable-download-to-local-file-system/206 "2020-09-19T06:49:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uniqueg](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/uniqueg/32/94_2.png) [@uniqueg](https://cwl.discourse.group/u/uniqueg)\
**Post date:** [September 19, 2020, 6:49am UTC](https://cwl.discourse.group/t/cwltool-flag-to-disable-download-to-local-file-system/206/1 "2020-09-19T06:49:35Z")

</div>

We’re using `cwl-tes` to run CWL workflows via a GA4GH TES instance, and we find that `cwltool`, by default, seems to download all input and output files to local storage. While that obviously makes sense when workflows are run locally by `cwltool`, it seems quite redundant and costly to do so when workflows are run in a distributed way like the described scenario.

So I’m wondering: Is there perhaps a flag to disable the download behavior? And if not, what are the chances to have such a feature merged if we file a PR for it? In the latter case, I would be grateful for a quick pointer and, if applicable, some comments on possible caveats.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![tetron](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/tetron/32/40_2.png) [@tetron](https://cwl.discourse.group/u/tetron)\
**Post date:** [September 22, 2020, 2:01pm UTC](https://cwl.discourse.group/t/cwltool-flag-to-disable-download-to-local-file-system/206/2 "2020-09-22T14:01:08Z")

</div>

In `cwltool` the file download happens in `PathMapper`. You probably want `cwl-tes` to provide a custom subclass of PathMapper that preserves those http URLs until you need them.

If you do that, you might also need to provide a `FsAccess` that understands http so that `cwltool` can fetch file metadata like size, type, and to be read contents for use in scripts.

---

<div class="post-metadata">

**Author:** ![mrc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/mrc/32/3_2.png) [@mrc](https://cwl.discourse.group/u/mrc)\
**Post date:** [September 22, 2020, 2:02pm UTC](https://cwl.discourse.group/t/cwltool-flag-to-disable-download-to-local-file-system/206/3 "2020-09-22T14:02:59Z")

</div>

Building on what @tetron said: here is the cwl-tes code to support FTP URLs: [https://github.com/ohsu-comp-bio/cwl-tes/blob/e3ca77ad48234aa7ad5e989964437f11a13bb3a4/cwl\_tes/ftp.py](https://github.com/ohsu-comp-bio/cwl-tes/blob/e3ca77ad48234aa7ad5e989964437f11a13bb3a4/cwl_tes/ftp.py) (written by me under a previous contract to EMBL-EBI)

---

<div class="post-metadata">

**Author:** ![uniqueg](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/uniqueg/32/94_2.png) [@uniqueg](https://cwl.discourse.group/u/uniqueg)\
**Post date:** [September 22, 2020, 3:15pm UTC](https://cwl.discourse.group/t/cwltool-flag-to-disable-download-to-local-file-system/206/4 "2020-09-22T15:15:21Z")

</div>

Thanks a ton, guys, those are just the pointers I needed 🙏
