Holiday Notice:
The Frontline Support team will be slow to respond December 17-18 due to an institute-wide retreat and offline December 22- January 1, while the institute is closed. Thank you for your patience during these next few weeks. Happy Holidays!

How to generate Array[File] output of variable size?

markwmarkw 7003AMember, Broadie, Moderator, Dev admin

I have a task that returns an Array[File] whose size is set by an input integer, like this:

task MyTask {
  Int size
  String dollar = "$" #workaround to access bash variables, see issue #1819
  command <<<
    for i in {0...${size}}; do
      echo "This is file ${dollar}{i}" > ${dollar}{i}.txt
      echo "${dollar}{i}.txt" >> output_files.txt
    done
  >>>
  output {
    Array[File] files = read_lines("output_files.txt")
  }
}

Using Cromwell 30 with JES, "output_files.txt" gets delocalized to the bucket instead of the actual files 0.txt, 1.txt, 2.txt, etc. Is this intentional behavior or a bug? Is there any other way to approach this problem?

Thank you.

Best Answer

Answers

Sign In or Register to comment.