Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FilePath globbing does not support curly brackets glob with only one entry, trailing comma #154

Closed
dtrudg opened this issue May 13, 2016 · 4 comments
Milestone

Comments

@dtrudg
Copy link

dtrudg commented May 13, 2016

I'm using curly bracket globbing to create a channel emitting multiple files where the files are listed in a string parameter separated by commas.

While playing with this I noticed that Nextflow doesn't recognize curly bracket globs with a single entry and trailing comma. These are actually valid glob patterns. e.g.:

{alice.txt,}

... is a valid glob pattern matching only alice.txt

It's unusual to have one of these, but I believe nextflow should support them as they are valid. This issue has come up in other software e.g. https://issues.jboss.org/browse/TORQUE-128

I believe that in FileHelper class:

static final public Pattern GLOB_CURLY_BRACKETS = Pattern.compile(/(.*)(\{.+,.+\})(.*)/)

...correct regex should allow trailing ',' inside the brackets....

static final public Pattern GLOB_CURLY_BRACKETS = Pattern.compile(/(.*)(\{.+,.*\})(.*)/)
@pditommaso
Copy link
Member

It makes sense.

pditommaso added a commit that referenced this issue May 13, 2016
pditommaso added a commit that referenced this issue May 13, 2016
pditommaso added a commit that referenced this issue May 13, 2016
@pditommaso
Copy link
Member

If so, also the following should be recognised at valid glob:

{,alice.txt}
{,}

@dctrud What do you think?

@dtrudg
Copy link
Author

dtrudg commented May 16, 2016

@pditommaso well they are valid with bash/ls. The second one evaluates to nothing...

dtrudgian@rop504388:~/test
10:22 PM $ ls {,alice.txt}
alice.txt
dtrudgian@rop504388:~/test
10:22 PM $ ls {,}
alice.txt mary.txt  test      testdir

Not sure whether they are valid for the java.nio globbing? I had a look online and couldn't find any complete definition of the globbing syntax that's valid for it.

@pditommaso
Copy link
Member

Yes, it is. I've added a couple of tests for that. Thanks.

@pditommaso pditommaso added this to the v0.19.0 milestone May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants