https://github.com/zshipko/seqdir
https://github.com/zshipko/seqdir
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zshipko/seqdir
- Owner: zshipko
- License: isc
- Created: 2022-04-26T00:29:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-26T02:18:12.000Z (about 4 years ago)
- Last Synced: 2025-01-22T14:08:09.770Z (over 1 year ago)
- Language: OCaml
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Seqdir
An OCaml package for recursively listing files
## Installation
Using opam:
```shell
$ opam pin add git+https://github.com/zshipko/seqdir
```
## Usage
`Seqdir.list` can be used to generate a sequence of filenames. For example, to list recursively all files in `/tmp`:
```ocaml
let () =
let filenames =
Seqdir.list "/tmp"
|> Seq.map Seqdir.Entry.filename
in
Seq.iter print_endline filenames
```
It's also possible to limit the depth using the optional `max_depth` parameter:
```ocaml
Seqdir.list ~max_depth:1 "/tmp"
```