Flier

Add some file functions in Elixir by adding some NIFs using Rustler.

Examples (inotify)

{:ok, ref} = Flier.Inotify.start_watcher("/tmp", [:create])
receive do
    {:inotify_event, file, masks} -> IO.puts("File '#{file}' triggered by #{inspect mask})
end
:stopped = Flier.Inotify.stop_watcher(ref)
"/tmp"
|> Flier.Inotify.stream([:close_write])
|> Enum.each(fn {file, mask} -> IO.puts("File '#{file}' triggered by #{inspect mask})

Examples (entries)

"/tmp"
|> Flier.Entries.stream()
|> Enum.each(fn entry -> IO.puts("Entry '#{entry.name}' is a '#{entry.type}'")

Installation

If available in Hex, the package can be installed by adding flier to your list of dependencies in mix.exs:

def deps do
  [
    {:flier, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/flier.