Coder Social home page Coder Social logo

fnotify's Introduction

fnotify

fnotify handles file change notifications. On linux fnotify is implemented with inotify and on mac os x and bsd's kevent is used.

The api is simple

fnotify:watch(Path) -> {ok,Wd} | {error,Reason}
fnotify:watch(Path,[Flag]) -> {ok,Wd} | {error,Reason}

To start watching a path

fnotify:unwatch(Wd) -> ok | {error,Reason}

To stop watching it.

The situation with the events is a bit more tricky, but the events looks like

{fevent,Wd,[Flag],Path,Name}

Simple flags passed to user are

  • create
  • delete
  • moved_from
  • moved_to
  • {cookie,Cookie}
  • attrib

Other flags include

  • modify
  • access
  • close_write
  • close_nowrite
  • delete_self
  • move_self
  • open
  • write
  • extend
  • link
  • rename
  • revoke

Mac OS X

Depending on how many libraries there are, a lot of filedescriptors may be consumed:

The way to add more file descriptors to processes on mac os x is to:

To check maximum possible sysctl kern.maxfilesperproc

To check process limits launchctl limit

To set process limits - works sometimes. launchctl limit maxfiles N N

fnotify's People

Contributors

malotte avatar tonyrog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fnotify's Issues

add MIT or LGPL license

MPL2 license can't be included in Apache abd BSD projects. Due to the nature of an Erlang release I suggest either to replace or maybe just add a license like LGPL or a BSD.

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.