Coder Social home page Coder Social logo

he9lin / dir_walker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pragdave/dir_walker

0.0 2.0 0.0 297 KB

Simple Elixir file-system directory tree walker. It can handle large filesystems, as the tree is traversed lazily.

Ruby 3.15% Elixir 96.85%

dir_walker's Introduction

DirWalker

DirWalker lazily traverses one or more directory trees, depth first, returning successive file names.

Initialize the walker using

{:ok, walker} = DirWalker.start_link(path, [, options ]) # or [path, path...]

Then return the next n path names using

paths = DirWalker.next(walker [, n \\ 1])

Successive calls to next will return successive file names, until all file names have been returned.

These methods have also been wrapped into a Stream resource.

paths = DirWalker.stream(path [, options]) # or [path,path...]

options is a map containing zero or more of:

  • include_stat: true

    Return tuples containing both the file name and the File.Stat structure for each file. This does not incur a performance penalty but obviously can use more memory.

  • include_dir_names: true

    Include the names of directories that are traversed (normally just the names of regular files are returned). Note that the order is such that directory names will typically be returned after the names of files in those directories.

  • matches: regex

    Only file names matching the regex will be returned. Does not affect directory traversals.

dir_walker's People

Contributors

bbense avatar pragdave avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.