Skip to content

Conversation

@bentsherman
Copy link
Member

@bentsherman bentsherman commented Nov 19, 2025

Fix #6152

The listFiles() method is problematic because the implementation returns a Path[] instead of a Collection<Path>. The array type supports most of the same functionality, but not all, leading to weird bugs such as not being able to supply as a process path input.

Additionally, TaskPath does not implement listFiles() correctly, which leads to strange errors when calling listFiles() on a task input in the task body.

  • Introduce listDirectory() as a replacement for listFiles() that doesn't have the above issues

  • Deprecate listFiles() in the Nextflow language (doesn't need to be deprecated in the runtime)

  • Clean up documentation of Path type

@bentsherman bentsherman requested a review from jorgee November 19, 2025 05:05
@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit e2d4161
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6920aea01c14d000080185ff
😎 Deploy Preview https://deploy-preview-6581--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pditommaso

This comment was marked as resolved.

@bentsherman

This comment was marked as resolved.

pditommaso

This comment was marked as resolved.

@bentsherman bentsherman changed the title Change return type of listFiles() from Path[] to List<Path> Add listDirectory() to Path type and deprecate listFiles() Nov 21, 2025
@bentsherman bentsherman dismissed pditommaso’s stale review November 21, 2025 18:18

Comments addressed

@bentsherman bentsherman force-pushed the 6152-fix-listfiles-return-type branch from b43bdd5 to e2d4161 Compare November 21, 2025 18:25
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

Successfully merging this pull request may close these issues.

Unable to use basic groovy operations on process path() input Path listFiles return type not accepted by process path input

4 participants