Skip to content

Output file("*.foo") returns a single file or list #1236

@heuermh

Description

@heuermh

Bug report

Capturing wildcard files in an output: block

process split_foo_gz {
  input:
    set sample, file(foo) from foos
  output:
    set sample, file("*.foo.gz") into splitFoos
...

appears to result in either a single file or a list of files, which makes downstream code confusing or tricky, e.g. in this attempt to print the size of the list of files, it prints the size (in bytes presumably?) of a single file

$ nextflow split_fasta_gz.nf
N E X T F L O W  ~  version 19.04.1
Launching `split_fasta_gz.nf` [amazing_lalande] - revision: 3bb463322d
[warm up] executor > local
executor >  local (2)
[f6/b16ff4] process > split_fasta_gz [  0%] 0 of 2

Split reference to 117968 files:
work/a3/eaa67d4822b8dfe66b5292c4f65352/reference.0.fa.gz

Split transcript to 10 files:
[work/f6/b16ff41dc6aee15e8c45e5f851e6e5/transcript.0.fa.gz, work/f6
/b16ff41dc6aee15e8c45e5f851e6e5/transcript.1.fa.gz, ... >  local (2)

Expected behavior and actual behavior

Always return a list, even if it contains zero or one files.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions