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

/file: readDir to distinguish files from dirs #666

Open
mindrones opened this issue May 3, 2023 · 0 comments
Open

/file: readDir to distinguish files from dirs #666

mindrones opened this issue May 3, 2023 · 0 comments

Comments

@mindrones
Copy link
Contributor

mindrones commented May 3, 2023

It would be useful to be able to specify what we are looking for (files and/or dirs).

We could pass a second argument like below (non-breaking):

> readDir('aPath', 'dir')
['dir1', 'dir2']
> readDir('aPath', 'file')
['file.txt', 'file.csv']
> readDir('aPath')
['dir1', 'dir2', 'file.txt', 'file.csv']

The output could be partitioned (which would be a breaking change) like this:

> readDir('aPath')
{
  dir: ['dir1', 'dir2'],
  file: ['file.txt', 'file.csv']
}

or like this (breaking, less clear)

> readDir('aPath')
[
  ['dir1', 'dir2'],
  ['file.txt', 'file.csv']
]
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

1 participant