Skip to content
Snippets Groups Projects
Commit d1f3dbbe authored by Peter Ericson's avatar Peter Ericson Committed by Xiangrong Hao
Browse files

Add support for OpenBSD (#45)

parent 8bf77718
No related branches found
No related tags found
No related merge requests found
......@@ -6,10 +6,10 @@ A file change watcher wrapper based on [fs](https://github.com/synrc/fs)
## System Support
- Mac fsevent
- Linux and FreeBSD inotify
- Linux, FreeBSD and OpenBSD inotify
- Windows inotify-win
NOTE: On Linux and FreeBSD you need to install inotify-tools.
NOTE: On Linux, FreeBSD and OpenBSD you need to install inotify-tools.
## Usage
......
......@@ -7,7 +7,7 @@ defmodule FileSystem do
* `:dirs` ([string], required), the dir list to monitor
* `:backend` (atom, optional), default backends: `:fs_mac`
for `macos`, `:fs_inotify` for `linux` and `freebsd`,
for `macos`, `:fs_inotify` for `linux`, `freebsd` and `openbsd`,
`:fs_windows` for `windows`
* `:name` (atom, optional), `name` can be used to subscribe as
......
......@@ -33,6 +33,7 @@ defmodule FileSystem.Backend do
{:unix, :darwin} -> :fs_mac
{:unix, :linux} -> :fs_inotify
{:unix, :freebsd} -> :fs_inotify
{:unix, :openbsd} -> :fs_inotify
{:win32, :nt} -> :fs_windows
system -> {:unsupported_system, system}
end |> backend_module
......
......@@ -3,7 +3,7 @@ require Logger
defmodule FileSystem.Backends.FSInotify do
@moduledoc """
This file is a fork from https://github.com/synrc/fs.
FileSysetm backend for linux and freebsd, a GenServer receive data from Port, parse event
FileSysetm backend for linux, freebsd and openbsd, a GenServer receive data from Port, parse event
and send it to the worker process.
Need `inotify-tools` installed to use this backend.
......@@ -37,7 +37,7 @@ defmodule FileSystem.Backends.FSInotify do
end
def supported_systems do
[{:unix, :linux}, {:unix, :freebsd}]
[{:unix, :linux}, {:unix, :freebsd}, {:unix, :openbsd}]
end
def known_events do
......
......@@ -23,7 +23,7 @@ defmodule FileSystem.Backends.FSPoll do
def bootstrap, do: :ok
def supported_systems do
[{:unix, :linux}, {:unix, :freebsd}, {:unix, :darwin}, {:win32, :nt}]
[{:unix, :linux}, {:unix, :freebsd}, {:unix, :openbsd}, {:unix, :darwin}, {:win32, :nt}]
end
def known_events do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment