From 45ca2003b208f461ef4acd56c5fdecd2e98e1f33 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Wed, 8 Jan 2020 22:27:33 +0200 Subject: [PATCH 01/37] 2020 6.1 --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e083fbb..eaf7723 100644 --- a/index.html +++ b/index.html @@ -30,8 +30,8 @@

MODULES


- AUG 2014 © proger ISC
- VER 4.10 4.1 2.12 + JAN 2020 © proger ISC
+ VER 6.1 4.10 4.1
From a40ccb02e2c40ec82ff44e300784bb00f024e9e6 Mon Sep 17 00:00:00 2001 From: Dominic Letz Date: Tue, 8 Sep 2020 13:40:14 +0200 Subject: [PATCH 02/37] Fixed unicode characters on linux --- src/sys/inotifywait.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sys/inotifywait.erl b/src/sys/inotifywait.erl index 9125e82..38a1833 100644 --- a/src/sys/inotifywait.erl +++ b/src/sys/inotifywait.erl @@ -11,9 +11,10 @@ start_port(Path, Cwd) -> "-m", "-e", "modify", "-e", "close_write", "-e", "moved_to", "-e", "create", "-e", "delete", "-e", "attrib", "--quiet", "-r", Path1], erlang:open_port({spawn_executable, os:find_executable("sh")}, - [stream, exit_status, {line, 16384}, {args, Args}, {cd, Cwd}]). + [stream, exit_status, binary, {line, 16384}, {args, Args}, {cd, Cwd}]). -line_to_event(Line) -> +line_to_event(Line0) -> + Line = unicode:characters_to_list(Line0, utf8), {match, [Dir, Flags1, DirEntry]} = re:run(Line, re(), [{capture, all_but_first, list}]), Flags = [convert_flag(F) || F <- string:tokens(Flags1, ",")], Path = Dir ++ DirEntry, From 23e582e595cf13c8151d8b50146c4bb43e07f569 Mon Sep 17 00:00:00 2001 From: Dominic Letz Date: Tue, 8 Sep 2020 13:41:53 +0200 Subject: [PATCH 03/37] Fixed unicode characters on mac --- src/sys/fsevents.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sys/fsevents.erl b/src/sys/fsevents.erl index 8561e80..30feafe 100644 --- a/src/sys/fsevents.erl +++ b/src/sys/fsevents.erl @@ -12,9 +12,10 @@ known_events() -> start_port(Path, Cwd) -> erlang:open_port({spawn_executable, find_executable()}, - [stream, exit_status, {line, 16384}, {args, ["-F", Path]}, {cd, Cwd}]). + [stream, exit_status, binary, {line, 16384}, {args, ["-F", Path]}, {cd, Cwd}]). -line_to_event(Line) -> +line_to_event(Line0) -> + Line = unicode:characters_to_list(Line0, utf8), [_EventId, Flags1, Path] = string:tokens(Line, [$\t]), [_, Flags2] = string:tokens(Flags1, [$=]), {ok, T, _} = erl_scan:string(Flags2 ++ "."), From ec9d008ad5d0aae31ee5bee537e6c116e5d17f9b Mon Sep 17 00:00:00 2001 From: 5HT Date: Tue, 8 Sep 2020 15:06:18 +0300 Subject: [PATCH 04/37] 6.9.0 --- mix.exs | 2 +- src/fs.app.src | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index b530d9e..4fb17ec 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule FS.Mixfile do def project do [app: :fs, - version: "6.1.1", + version: "6.9.0", description: "FS Native Listener (Mac Windows Linux)", deps: deps(), docs: [], diff --git a/src/fs.app.src b/src/fs.app.src index 5c1b0d4..5968d8a 100644 --- a/src/fs.app.src +++ b/src/fs.app.src @@ -1,6 +1,6 @@ {application, fs, [{description, "FS Native Listener (Mac Windows Linux)"}, - {vsn, "6.1.1"}, + {vsn, "6.9.0"}, {registered, []}, {applications, [kernel,stdlib]}, {mod, { fs_app, []}}, From b284a180a003eacec99c00be7b5faccb95c08bba Mon Sep 17 00:00:00 2001 From: Ashish SHUKLA Date: Tue, 2 Jan 2018 16:03:47 +0100 Subject: [PATCH 05/37] kqueue backend: fix kqueue event flags - EV_ENABLE, and EV_DISABLE are mutually exclusive - EV_RECEIPT causes kevent(2) to be returned immediately with EV_ERROR as status, which doesn't seem to be the intent of the invocation. --- c_src/bsd/main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/c_src/bsd/main.c b/c_src/bsd/main.c index 72bcb2b..e3a1b03 100644 --- a/c_src/bsd/main.c +++ b/c_src/bsd/main.c @@ -11,12 +11,9 @@ int main(int argc, char *argv[]) { int fd, kq, nev; if ((fd = open(argv[1], O_RDONLY)) == -1) return 1; EV_SET(&change, fd, EVFILT_VNODE , EV_ADD - | EV_ENABLE - | EV_DISABLE | EV_CLEAR | EV_DELETE | EV_EOF - | EV_RECEIPT | EV_DISPATCH | EV_ONESHOT, NOTE_DELETE From 1c1634e9e1c819da0e61e5a7961a97f24a970ade Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Thu, 29 Oct 2020 04:23:18 +0200 Subject: [PATCH 06/37] Update .travis.yml --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 60319f4..f18000f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ language: erlang otp_release: - - 19.3 + - 20.0 + - 21.0 + - 22.0 + - 23.0 script: - "curl -fsSL https://raw.github.com/synrc/mad/master/mad > mad && chmod +x mad && ./mad dep com" - "rebar3 dialyzer" From c067638805569a6acc1010814206421db330a213 Mon Sep 17 00:00:00 2001 From: Dominic Letz Date: Tue, 3 Nov 2020 16:08:38 +0100 Subject: [PATCH 07/37] Fix watching directories with spaces on Linux --- src/sys/inotifywait.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/inotifywait.erl b/src/sys/inotifywait.erl index 38a1833..e26aced 100644 --- a/src/sys/inotifywait.erl +++ b/src/sys/inotifywait.erl @@ -7,7 +7,7 @@ known_events() -> [created, deleted, renamed, closed, modified, isdir, attribute start_port(Path, Cwd) -> Path1 = filename:absname(Path), - Args = ["-c", "inotifywait $0 $@ & PID=$!; read a; kill $PID", + Args = ["-c", "inotifywait \"$0\" \"$@\" & PID=$!; read a; kill $PID", "-m", "-e", "modify", "-e", "close_write", "-e", "moved_to", "-e", "create", "-e", "delete", "-e", "attrib", "--quiet", "-r", Path1], erlang:open_port({spawn_executable, os:find_executable("sh")}, From 2223a2051b7d50220a67f31082d4dd0cb11f6eb9 Mon Sep 17 00:00:00 2001 From: Dominic Letz Date: Thu, 5 Nov 2020 12:29:17 +0100 Subject: [PATCH 08/37] Added move_from to linux watched events. This event happens on gnome and other window managers when an item is moved to the trash. --- src/sys/inotifywait.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sys/inotifywait.erl b/src/sys/inotifywait.erl index e26aced..8ac523c 100644 --- a/src/sys/inotifywait.erl +++ b/src/sys/inotifywait.erl @@ -8,7 +8,7 @@ known_events() -> [created, deleted, renamed, closed, modified, isdir, attribute start_port(Path, Cwd) -> Path1 = filename:absname(Path), Args = ["-c", "inotifywait \"$0\" \"$@\" & PID=$!; read a; kill $PID", - "-m", "-e", "modify", "-e", "close_write", "-e", "moved_to", "-e", "create", "-e", "delete", + "-m", "-e", "modify", "-e", "close_write", "-e", "moved_to", "-e", "moved_from", "-e", "create", "-e", "delete", "-e", "attrib", "--quiet", "-r", Path1], erlang:open_port({spawn_executable, os:find_executable("sh")}, [stream, exit_status, binary, {line, 16384}, {args, Args}, {cd, Cwd}]). @@ -27,6 +27,7 @@ convert_flag("MODIFY") -> modified; convert_flag("CLOSE_WRITE") -> modified; convert_flag("CLOSE") -> closed; convert_flag("MOVED_TO") -> renamed; +convert_flag("MOVED_FROM") -> removed; convert_flag("ATTRIB") -> attribute; convert_flag(_) -> undefined. From 43b6354d0c3055f1534dd8cbe2ddd707674cf092 Mon Sep 17 00:00:00 2001 From: Dominic Letz Date: Fri, 13 Nov 2020 13:12:53 +0100 Subject: [PATCH 09/37] Use :mix_rebar3 to compile, so macos binary is always built --- mix.exs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 4fb17ec..53f7002 100644 --- a/mix.exs +++ b/mix.exs @@ -7,6 +7,7 @@ defmodule FS.Mixfile do description: "FS Native Listener (Mac Windows Linux)", deps: deps(), docs: [], + compilers: [:rebar3], package: package()] end @@ -19,6 +20,7 @@ defmodule FS.Mixfile do end defp deps do - [{:ex_doc, "~> 0.11", only: :dev}] + [{:ex_doc, "~> 0.11", only: :dev}, + {:mix_rebar3, "~> 0.1", runtime: false}] end end From 04337bdd6d7c2b5d74bbeb4f75fd2ec34b48290a Mon Sep 17 00:00:00 2001 From: Gustavo Schirmer Date: Mon, 30 Nov 2020 11:10:59 -0300 Subject: [PATCH 10/37] feat: Big Sur compatibility --- c_src/mac/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/c_src/mac/main.c b/c_src/mac/main.c index 7b31f27..0d6687e 100644 --- a/c_src/mac/main.c +++ b/c_src/mac/main.c @@ -85,29 +85,29 @@ static inline void parse_cli_settings(int argc, const char* argv[]) } if (args_info.ignore_self_flag) { - if ((osMajorVersion == 10) & (osMinorVersion >= 6)) { - config.flags |= kFSEventStreamCreateFlagIgnoreSelf; - } else { + if ((osMajorVersion < 10) || ((osMajorVersion == 10) && (osMinorVersion >= 6))) { fprintf(stderr, "MacOSX 10.6 or later is required for --ignore-self\n"); exit(EXIT_FAILURE); + } else { + config.flags |= kFSEventStreamCreateFlagIgnoreSelf; } } if (args_info.file_events_flag) { - if ((osMajorVersion == 10) & (osMinorVersion >= 7)) { - config.flags |= kFSEventStreamCreateFlagFileEvents; - } else { + if ((osMajorVersion < 10) || ((osMajorVersion == 10) && (osMinorVersion < 7))) { fprintf(stderr, "MacOSX 10.7 or later required for --file-events\n"); exit(EXIT_FAILURE); + } else { + config.flags |= kFSEventStreamCreateFlagFileEvents; } } if (args_info.mark_self_flag) { - if ((osMajorVersion == 10) & (osMinorVersion >= 9)) { - config.flags |= kFSEventStreamCreateFlagMarkSelf; - } else { + if ((osMajorVersion < 10) || ((osMajorVersion == 10) && (osMinorVersion < 9))) { fprintf(stderr, "MacOSX 10.9 or later required for --mark-self\n"); exit(EXIT_FAILURE); + } else { + config.flags |= kFSEventStreamCreateFlagMarkSelf; } } From 118017c04128ae0c0621158b6eefee070dc6e478 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Sun, 6 Dec 2020 00:48:26 +0200 Subject: [PATCH 11/37] 6.12.0 --- mix.exs | 3 ++- src/fs.app.src | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 53f7002..3dd76db 100644 --- a/mix.exs +++ b/mix.exs @@ -3,8 +3,9 @@ defmodule FS.Mixfile do def project do [app: :fs, - version: "6.9.0", + version: "6.12.0", description: "FS Native Listener (Mac Windows Linux)", + elixir: "~> 1.9", deps: deps(), docs: [], compilers: [:rebar3], diff --git a/src/fs.app.src b/src/fs.app.src index 5968d8a..77e366e 100644 --- a/src/fs.app.src +++ b/src/fs.app.src @@ -1,6 +1,6 @@ {application, fs, [{description, "FS Native Listener (Mac Windows Linux)"}, - {vsn, "6.9.0"}, + {vsn, "6.12.0"}, {registered, []}, {applications, [kernel,stdlib]}, {mod, { fs_app, []}}, From 36060cc210d44ec27d3bcef260f8869d180fa7ca Mon Sep 17 00:00:00 2001 From: Logan Bresnahan Date: Mon, 7 Dec 2020 13:48:14 -0600 Subject: [PATCH 12/37] Fix Incorrect Version Error When Used with Mac OS 11 or Greater Gestalt Manager is considered deprecated (https://developer.apple.com/documentation/coreservices/carbon_core/gestalt_manager?language=objc) and an incorrect error is thrown when using this package with Mac OS 11 "MacOSX 10.7 or later required for --file-events" --- c_src/mac/main.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/c_src/mac/main.c b/c_src/mac/main.c index 0d6687e..ce4b0ed 100644 --- a/c_src/mac/main.c +++ b/c_src/mac/main.c @@ -1,5 +1,8 @@ #include "common.h" #include "cli.h" +#include +#include +#include // TODO: set on fire. cli.{h,c} handle both parsing and defaults, so there's // no need to set those here. also, in order to scope metadata by path, @@ -49,12 +52,14 @@ static void append_path(const char* path) static inline void parse_cli_settings(int argc, const char* argv[]) { // runtime os version detection - SInt32 osMajorVersion, osMinorVersion; - if (!(Gestalt(gestaltSystemVersionMajor, &osMajorVersion) == noErr)) { - osMajorVersion = 0; - } - if (!(Gestalt(gestaltSystemVersionMinor, &osMinorVersion) == noErr)) { - osMinorVersion = 0; + char buf[25]; + size_t buflen = 25; + sysctlbyname("kern.osproductversion", &buf, &buflen, NULL, 0); + int osMajorVersion, osMinorVersion; + int res = sscanf(buf, "%d.%d", &osMajorVersion, &osMinorVersion); + if (res != 2) + { + osMajorVersion = osMinorVersion = 0; } if ((osMajorVersion == 10) & (osMinorVersion < 5)) { From 4e55d9dd95aae60b56c76c29d0c5b383e085e5e6 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Thu, 4 Feb 2021 18:21:43 +0200 Subject: [PATCH 13/37] Create .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f9643b3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.c linguist-detectable=false From b483f968b27e9b48499a87c129c9a2e3b12cca27 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Thu, 4 Feb 2021 18:25:11 +0200 Subject: [PATCH 14/37] Update .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index f9643b3..7a9d956 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ *.c linguist-detectable=false +*.cs linguist-detectable=false From 25082a20a2034f323527e1b7617ba0198156c72d Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Thu, 4 Feb 2021 18:25:39 +0200 Subject: [PATCH 15/37] Update .gitattributes --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index 7a9d956..dafc930 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ *.c linguist-detectable=false +*.cc linguist-detectable=false +Makefile linguist-detectable=false *.cs linguist-detectable=false From a9a2bf6892d8fc4479b7393bc6d10ce8a6975b29 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Thu, 4 Feb 2021 18:26:03 +0200 Subject: [PATCH 16/37] Update .gitattributes --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index dafc930..8f44ed8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,5 @@ *.cc linguist-detectable=false Makefile linguist-detectable=false *.cs linguist-detectable=false +*.html linguist-detectable=false +*.htm linguist-detectable=false From 03ec15f39d645762dee19c287258319859230174 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Thu, 4 Feb 2021 23:04:31 +0200 Subject: [PATCH 17/37] Update elixir.yml --- .github/workflows/elixir.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index f2560f5..6d3c66f 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -4,10 +4,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - uses: actions/setup-elixir@v1.0.0 + - uses: actions/checkout@v2 + - uses: erlef/setup-elixir@v1 with: - otp-version: 22.x + otp-version: 23.x elixir-version: 1.9.x - name: Dependencies run: | From 337f80ef4290bb08b18f2cf6ddc1d32f0fb6fcd6 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Sun, 7 Nov 2021 18:30:08 +0200 Subject: [PATCH 18/37] rebar3 format --- rebar.config | 17 +++++++ src/fs.erl | 107 ++++++++++++++++++++++++++-------------- src/fs_app.erl | 6 ++- src/fs_event_bridge.erl | 18 ++++++- src/fs_server.erl | 55 +++++++++++++++++---- src/fs_sup.erl | 57 ++++++++++++++------- 6 files changed, 192 insertions(+), 68 deletions(-) diff --git a/rebar.config b/rebar.config index aa987fe..633a5c0 100644 --- a/rebar.config +++ b/rebar.config @@ -24,3 +24,20 @@ % {"win32", clean, "make -f c_src/windows/Makefile clean"} % ] %}. + +{project_plugins, [rebar3_format]}. +{format, [ + {files, ["src/*.erl", "test/*.erl"]}, + {formatter, otp_formatter}, + {options, #{ line_length => 108, + paper => 250, + spaces_around_fields => false, + inlining => all, + inline_clause_bodies => true, + inline_expressions => true, + inline_qualified_function_composition => true, + inline_simple_funs => true, + inline_items => all, + inline_fields => true, + inline_attributes => true + }}]}. diff --git a/src/fs.erl b/src/fs.erl index 1953eaf..6ea2ffe 100644 --- a/src/fs.erl +++ b/src/fs.erl @@ -1,75 +1,110 @@ -module(fs). + -include_lib("kernel/include/file.hrl"). --export([start_link/1, start_link/2, subscribe/0, subscribe/1, known_events/0, known_events/1, - start_looper/0, start_looper/1, find_executable/2, path/0]). + +-export([start_link/1, + start_link/2, + subscribe/0, + subscribe/1, + known_events/0, + known_events/1, + start_looper/0, + start_looper/1, + find_executable/2, + path/0]). % sample subscriber start_link(Name) -> start_link(Name, path()). + start_link(Name, Path) -> SupName = name(Name, "sup"), FileHandler = name(Name, "file"), fs_sup:start_link(SupName, Name, FileHandler, Path). subscribe() -> subscribe(default_fs). -subscribe(Name) -> gen_event:add_sup_handler(Name, {fs_event_bridge, self()}, [self()]). + +subscribe(Name) -> + gen_event:add_sup_handler(Name, + {fs_event_bridge, self()}, + [self()]). path() -> case application:get_env(fs, path) of {ok, P} -> filename:absname(P); - undefined -> filename:absname("") end. + undefined -> filename:absname("") + end. known_events() -> known_events(default_fs). -known_events(Name) -> gen_server:call(name(Name, "file"), known_events). + +known_events(Name) -> + gen_server:call(name(Name, "file"), known_events). start_looper() -> start_looper(default_fs). -start_looper(Name) -> spawn(fun() -> subscribe(Name), loop() end). + +start_looper(Name) -> + spawn(fun () -> + subscribe(Name), + loop() + end). loop() -> receive - {_Pid, {fs, file_event}, {Path, Flags}} -> error_logger:info_msg("file_event: ~p ~p", [Path, Flags]); - _ -> ignore end, + {_Pid, {fs, file_event}, {Path, Flags}} -> + error_logger:info_msg("file_event: ~p ~p", + [Path, Flags]); + _ -> ignore + end, loop(). find_executable(Cmd, DepsPath) -> case priv_file(Cmd) of - false -> mad_file(DepsPath); - Priv -> Priv end. + false -> mad_file(DepsPath); + Priv -> Priv + end. mad_file(DepsPath) -> case filelib:is_regular(DepsPath) of - true -> path() ++ "/" ++ DepsPath; - false -> - case load_file(DepsPath) of - {error,_} -> - %% This path has been already checked in find_executable/2 - false; - {ok,ETSFile} -> - filelib:ensure_dir(DepsPath), - file:write_file(DepsPath, ETSFile), - file:write_file_info(DepsPath, #file_info{mode=8#00555}) end end. + true -> path() ++ "/" ++ DepsPath; + false -> + case load_file(DepsPath) of + {error, _} -> + %% This path has been already checked in find_executable/2 + false; + {ok, ETSFile} -> + filelib:ensure_dir(DepsPath), + file:write_file(DepsPath, ETSFile), + file:write_file_info(DepsPath, + #file_info{mode = 8#00555}) + end + end. priv_file(Cmd) -> case code:priv_dir(fs) of - Priv when is_list(Priv) -> - Path = filename:join(Priv, Cmd), - case filelib:is_regular(Path) of - true -> Path; - false -> false end; - _ -> - false end. + Priv when is_list(Priv) -> + Path = filename:join(Priv, Cmd), + case filelib:is_regular(Path) of + true -> Path; + false -> false + end; + _ -> false + end. name(Name, Prefix) -> NameList = erlang:atom_to_list(Name), list_to_atom(NameList ++ Prefix). ets_created() -> - case ets:info(filesystem) of - undefined -> ets:new(filesystem,[set,named_table,{keypos,1},public]); - _ -> skip end. - - load_file(Name) -> - ets_created(), - case ets:lookup(filesystem,Name) of - [{Name,Bin}] -> {ok,Bin}; - _ -> {error,etsfs} end. + case ets:info(filesystem) of + undefined -> + ets:new(filesystem, + [set, named_table, {keypos, 1}, public]); + _ -> skip + end. + +load_file(Name) -> + ets_created(), + case ets:lookup(filesystem, Name) of + [{Name, Bin}] -> {ok, Bin}; + _ -> {error, etsfs} + end. diff --git a/src/fs_app.erl b/src/fs_app.erl index f70ab83..9ddadce 100644 --- a/src/fs_app.erl +++ b/src/fs_app.erl @@ -1,9 +1,13 @@ -module(fs_app). + -behaviour(application). + -export([start/2, stop/1]). start(_StartType, _StartArgs) -> case application:get_env(fs, backwards_compatible) of {ok, false} -> {ok, self()}; - {ok, true} -> fs:start_link(default_fs) end. + {ok, true} -> fs:start_link(default_fs) + end. + stop(_State) -> ok. diff --git a/src/fs_event_bridge.erl b/src/fs_event_bridge.erl index a9dc440..6f0cc15 100644 --- a/src/fs_event_bridge.erl +++ b/src/fs_event_bridge.erl @@ -1,10 +1,24 @@ -module(fs_event_bridge). + -behaviour(gen_event). --export([init/1, handle_event/2, handle_call/2, handle_info/2, code_change/3, terminate/2]). + +-export([init/1, + handle_event/2, + handle_call/2, + handle_info/2, + code_change/3, + terminate/2]). init([Pid]) -> {ok, Pid}. -handle_event(Event, Pid) -> Pid ! Event, {ok, Pid}. + +handle_event(Event, Pid) -> + Pid ! Event, + {ok, Pid}. + handle_call(_, State) -> {ok, ok, State}. + handle_info(_, State) -> {ok, State}. + code_change(_OldVsn, State, _Extra) -> {ok, State}. + terminate(_Reason, _State) -> ok. diff --git a/src/fs_server.erl b/src/fs_server.erl index 237a682..937f8eb 100644 --- a/src/fs_server.erl +++ b/src/fs_server.erl @@ -1,26 +1,61 @@ -module(fs_server). + -behaviour(gen_server). + -define(SERVER, ?MODULE). + -export([start_link/5]). --export([init/1, handle_call/3, handle_cast/2, handle_info/2,terminate/2, code_change/3]). + +-export([init/1, + handle_call/3, + handle_cast/2, + handle_info/2, + terminate/2, + code_change/3]). -record(state, {event_handler, port, path, backend}). -notify(EventHandler, file_event = A, Msg) -> Key = {fs, A}, gen_event:notify(EventHandler, {self(), Key, Msg}). -start_link(Name, EventHandler, Backend, Path, Cwd) -> gen_server:start_link({local, Name}, ?MODULE, [EventHandler, Backend, Path, Cwd], []). -init([EventHandler, Backend, Path, Cwd]) -> {ok, #state{event_handler=EventHandler,port=Backend:start_port(Path, Cwd),path=Path,backend=Backend}}. +notify(EventHandler, file_event = A, Msg) -> + Key = {fs, A}, + gen_event:notify(EventHandler, {self(), Key, Msg}). + +start_link(Name, EventHandler, Backend, Path, Cwd) -> + gen_server:start_link({local, Name}, + ?MODULE, + [EventHandler, Backend, Path, Cwd], + []). + +init([EventHandler, Backend, Path, Cwd]) -> + {ok, + #state{event_handler = EventHandler, + port = Backend:start_port(Path, Cwd), path = Path, + backend = Backend}}. + +handle_call(known_events, _From, + #state{backend = Backend} = State) -> + {reply, Backend:known_events(), State}; +handle_call(_Request, _From, State) -> + {reply, ok, State}. -handle_call(known_events, _From, #state{backend=Backend} = State) -> {reply, Backend:known_events(), State}; -handle_call(_Request, _From, State) -> {reply, ok, State}. handle_cast(_Msg, State) -> {noreply, State}. -handle_info({_Port, {data, {eol, Line}}}, #state{event_handler=EventHandler,backend=Backend} = State) -> + +handle_info({_Port, {data, {eol, Line}}}, + #state{event_handler = EventHandler, + backend = Backend} = + State) -> Event = Backend:line_to_event(Line), notify(EventHandler, file_event, Event), {noreply, State}; handle_info({_Port, {data, {noeol, Line}}}, State) -> - error_logger:error_msg("~p line too long: ~p, ignoring~n", [?SERVER, Line]), + error_logger:error_msg("~p line too long: ~p, ignoring~n", + [?SERVER, Line]), {noreply, State}; -handle_info({_Port, {exit_status, Status}}, State) -> {stop, {port_exit, Status}, State}; +handle_info({_Port, {exit_status, Status}}, State) -> + {stop, {port_exit, Status}, State}; handle_info(_Info, State) -> {noreply, State}. -terminate(_Reason, #state{port=Port}) -> (catch port_close(Port)), ok. + +terminate(_Reason, #state{port = Port}) -> + catch port_close(Port), + ok. + code_change(_OldVsn, State, _Extra) -> {ok, State}. diff --git a/src/fs_sup.erl b/src/fs_sup.erl index 58677be..5709bec 100644 --- a/src/fs_sup.erl +++ b/src/fs_sup.erl @@ -1,36 +1,55 @@ -module(fs_sup). + -behaviour(supervisor). + -export([start_link/4]). + -export([init/1]). --define(CHILD(I, Type, Args), {I, {I, start_link, Args}, permanent, 5000, Type, [I]}). + +-define(CHILD(I, Type, Args), + {I, {I, start_link, Args}, permanent, 5000, Type, [I]}). start_link(SupName, EventHandler, FileHandler, Path) -> - supervisor:start_link({local, SupName}, ?MODULE, [EventHandler, FileHandler, Path]). + supervisor:start_link({local, SupName}, + ?MODULE, + [EventHandler, FileHandler, Path]). + init([EventHandler, FileHandler, Path]) -> Backend = case os:type() of - {unix, darwin} -> fsevents; - {unix, linux} -> inotifywait; - {unix, sunos} -> undefined; - {unix, _} -> kqueue; - {win32, nt} -> inotifywait_win32; - _ -> undefined end, - + {unix, darwin} -> fsevents; + {unix, linux} -> inotifywait; + {unix, sunos} -> undefined; + {unix, _} -> kqueue; + {win32, nt} -> inotifywait_win32; + _ -> undefined + end, Children = case has_executable(Backend) of - false -> []; - true -> [?CHILD(fs_server, worker, [FileHandler, EventHandler, Backend, Path, Path])] end, - - {ok, { {one_for_one, 5, 10}, - Children ++ [?CHILD(gen_event, worker, [{local, EventHandler}])]} }. + false -> []; + true -> + [?CHILD(fs_server, worker, + [FileHandler, EventHandler, Backend, Path, Path])] + end, + {ok, + {{one_for_one, 5, 10}, + Children ++ + [?CHILD(gen_event, worker, [{local, EventHandler}])]}}. has_executable(undefined) -> - os_not_supported(), false; + os_not_supported(), + false; has_executable(Backend) -> case Backend:find_executable() of - false -> backend_port_not_found(Backend), false; - _ -> true end. + false -> + backend_port_not_found(Backend), + false; + _ -> true + end. os_not_supported() -> - error_logger:warning_msg("fs does not support the current operating system: auto-reloading might not work~n",[]). + error_logger:warning_msg("fs does not support the current operating " + "system: auto-reloading might not work~n", + []). backend_port_not_found(Backend) -> - error_logger:error_msg("backend port not found: ~p~n",[Backend]). + error_logger:error_msg("backend port not found: ~p~n", + [Backend]). From 5281a363956148db476b5dc60a8b82fb3305bea6 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Mon, 8 Nov 2021 12:28:06 +0200 Subject: [PATCH 19/37] 7.11.0 --- mix.exs | 2 +- src/fs.app.src | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 3dd76db..b97f9ae 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule FS.Mixfile do def project do [app: :fs, - version: "6.12.0", + version: "7.11.0", description: "FS Native Listener (Mac Windows Linux)", elixir: "~> 1.9", deps: deps(), diff --git a/src/fs.app.src b/src/fs.app.src index 77e366e..a72a76e 100644 --- a/src/fs.app.src +++ b/src/fs.app.src @@ -1,6 +1,6 @@ {application, fs, [{description, "FS Native Listener (Mac Windows Linux)"}, - {vsn, "6.12.0"}, + {vsn, "7.11.0"}, {registered, []}, {applications, [kernel,stdlib]}, {mod, { fs_app, []}}, From cd976642f7a995f8fa94a732d0ae927687f73a98 Mon Sep 17 00:00:00 2001 From: 5HT Date: Mon, 8 Nov 2021 18:52:58 +0200 Subject: [PATCH 20/37] Update index.html --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index eaf7723..43b72a5 100644 --- a/index.html +++ b/index.html @@ -30,8 +30,8 @@

MODULES


- JAN 2020 © proger ISC
- VER 6.1 4.10 4.1 + NOV 2021 © proger ISC
+ VER 7.11 6.1 4.10
From 5fbf65f7ce64c871632aa91caa2a193fe1589d24 Mon Sep 17 00:00:00 2001 From: 5HT Date: Thu, 7 Apr 2022 22:04:26 +0300 Subject: [PATCH 21/37] dharma license --- LICENSE | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ae12a40..eb4f47f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,27 @@ -Copyright (c) 2013 Vladimir Kirillov +DHARMA License + +Copyright (c) 2015—2022 Synrc Research Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. +YOU CANNOT USE THIS SOFTWARE IN ANY (PROVABLE BY MONEY TRACE) +PROCESS CHAIN OF EXTERMINATING UKRAINIANS BY ANY MEANS OF FASCIST +ACTIONS AGAINST OUR TERRITORIAL INTEGRITY, CULTURAL DIVERSITY BY +APPLYING MILITARY INVASIONS, ECONOMICAL WARS, HUMANITARIAN DISASTERS, +ARTFICIAL HOLODOMORS, GENOCIDE, RAPING, LOOTING, ROBBERIES, SPREADING +FAKE INFORMATION, AND OTHER CONTEMPORARY WEAPONS OF WAR AT SCALE +OR IN INVIDIVUAL MANNER. + +YOU CANNOT USE THIS SOFTWARE BY ANY MEANS IN INTEREST OF LEGAL +ENTITIES OR INDIVIDUALS WHO IS SUPPORTING NOW OR WAS SUPPORTING +BACK THEN FASCISM, RUSCISM, COMMUNISM, CHOVINISM, HUMILIATION, +AND OTHER SUPPRESSIVE IDEOLOGIES IN DIFFERENT EXPRESSIONS. + +STOP KILLING UKRAINIANS, +THE COUNTER RENDERS TENS OF MILLIONS. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR From a88ae82b1062db1a26b24e7d30b413b365a37d9e Mon Sep 17 00:00:00 2001 From: 5HT Date: Fri, 17 Jun 2022 17:40:02 +0300 Subject: [PATCH 22/37] synrc/fs#69 manual merge --- src/fs_server.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fs_server.erl b/src/fs_server.erl index 937f8eb..3825984 100644 --- a/src/fs_server.erl +++ b/src/fs_server.erl @@ -13,7 +13,7 @@ terminate/2, code_change/3]). --record(state, {event_handler, port, path, backend}). +-record(state, {event_handler, port, path, backend, cwd, crashes}). notify(EventHandler, file_event = A, Msg) -> Key = {fs, A}, @@ -29,7 +29,7 @@ init([EventHandler, Backend, Path, Cwd]) -> {ok, #state{event_handler = EventHandler, port = Backend:start_port(Path, Cwd), path = Path, - backend = Backend}}. + backend = Backend,cwd=Cwd,crashes=0}}. handle_call(known_events, _From, #state{backend = Backend} = State) -> @@ -50,8 +50,12 @@ handle_info({_Port, {data, {noeol, Line}}}, State) -> error_logger:error_msg("~p line too long: ~p, ignoring~n", [?SERVER, Line]), {noreply, State}; -handle_info({_Port, {exit_status, Status}}, State) -> - {stop, {port_exit, Status}, State}; + +handle_info({_Port, {exit_status, Status}}, #state{path=Path,backend=Backend,cwd=Cwd,crashes=Crashes} = State) -> + error_logger:error_msg("~p port_exit ~p, retry ~p~n", [?SERVER, Status, Crashes]), + timer:sleep(100*(Crashes+1)*(Crashes+1)), + {noreply, State#state{port=Backend:start_port(Path, Cwd),crashes=Crashes+1}}; + handle_info(_Info, State) -> {noreply, State}. terminate(_Reason, #state{port = Port}) -> From bf7b78708c2f127de7ccfab998428af9318692fa Mon Sep 17 00:00:00 2001 From: 5HT Date: Fri, 17 Jun 2022 17:41:44 +0300 Subject: [PATCH 23/37] 8.6.0 --- mix.exs | 2 +- src/fs.app.src | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index b97f9ae..217e161 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule FS.Mixfile do def project do [app: :fs, - version: "7.11.0", + version: "8.6.0", description: "FS Native Listener (Mac Windows Linux)", elixir: "~> 1.9", deps: deps(), diff --git a/src/fs.app.src b/src/fs.app.src index a72a76e..4c9b9a3 100644 --- a/src/fs.app.src +++ b/src/fs.app.src @@ -1,6 +1,6 @@ {application, fs, [{description, "FS Native Listener (Mac Windows Linux)"}, - {vsn, "7.11.0"}, + {vsn, "8.6.0"}, {registered, []}, {applications, [kernel,stdlib]}, {mod, { fs_app, []}}, From f493893bcf07a757d9de56eabcb1654ff1ec1ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=BD=A2=E0=BE=A3=E0=BD=98=E0=BC=8B=E0=BD=91=E0=BD=82?= =?UTF-8?q?=E0=BC=8B=E0=BD=A6=E0=BE=9F=E0=BD=BC=E0=BD=93=E0=BC=8B=E0=BD=94?= Date: Fri, 17 Jun 2022 17:43:33 +0300 Subject: [PATCH 24/37] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 69656f2..454062d 100644 --- a/README.md +++ b/README.md @@ -48,5 +48,6 @@ Credits * Vladimir Kirillov * Maxim Sokhatsky +* Dominic Letz OM A HUM From 28577f06abd184a9f6130c30e077c71dc69ff9fc Mon Sep 17 00:00:00 2001 From: 5HT Date: Fri, 17 Jun 2022 17:54:56 +0300 Subject: [PATCH 25/37] 8.6.1 fix edoc bug with macro unroll in export module attr --- rebar.config | 2 ++ src/sys/fsevents.erl | 2 +- src/sys/inotifywait.erl | 2 +- src/sys/inotifywait_win32.erl | 2 +- src/sys/kqueue.erl | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rebar.config b/rebar.config index 633a5c0..1b8e2f2 100644 --- a/rebar.config +++ b/rebar.config @@ -7,6 +7,8 @@ {"freebsd", "CFLAGS", ""}] }. +{hex, [{doc, edoc}]}. + {port_specs, [{"darwin", "priv/mac_listener", ["c_src/mac/*.c"]}, {"freebsd", "priv/kqueue", ["c_src/bsd/*.c"]} diff --git a/src/sys/fsevents.erl b/src/sys/fsevents.erl index 30feafe..0a648bf 100644 --- a/src/sys/fsevents.erl +++ b/src/sys/fsevents.erl @@ -1,6 +1,6 @@ -module(fsevents). -include("api.hrl"). --export(?API). +-export([find_executable/0, start_port/2, known_events/0, line_to_event/1]). find_executable() -> fs:find_executable("mac_listener", "deps/fs/priv/mac_listener"). diff --git a/src/sys/inotifywait.erl b/src/sys/inotifywait.erl index 8ac523c..3d712a0 100644 --- a/src/sys/inotifywait.erl +++ b/src/sys/inotifywait.erl @@ -1,6 +1,6 @@ -module(inotifywait). -include("api.hrl"). --export(?API). +-export([find_executable/0, start_port/2, known_events/0, line_to_event/1]). find_executable() -> os:find_executable("inotifywait"). known_events() -> [created, deleted, renamed, closed, modified, isdir, attribute, undefined]. diff --git a/src/sys/inotifywait_win32.erl b/src/sys/inotifywait_win32.erl index 5ad8d19..91ef467 100644 --- a/src/sys/inotifywait_win32.erl +++ b/src/sys/inotifywait_win32.erl @@ -1,6 +1,6 @@ -module(inotifywait_win32). -include("api.hrl"). --export(?API). +-export([find_executable/0, start_port/2, known_events/0, line_to_event/1]). find_executable() -> fs:find_executable("inotifywait.exe", "deps/fs/priv/inotifywait.exe"). diff --git a/src/sys/kqueue.erl b/src/sys/kqueue.erl index 9928912..a19bfe8 100644 --- a/src/sys/kqueue.erl +++ b/src/sys/kqueue.erl @@ -1,6 +1,6 @@ -module(kqueue). -include("api.hrl"). --export(?API). +-export([find_executable/0, start_port/2, known_events/0, line_to_event/1]). known_events() -> [created, deleted, renamed, closed, modified, isdir, undefined]. line_to_event(Line) -> From 73784d45ed0547e730ffb8907f1e0b2378f440a0 Mon Sep 17 00:00:00 2001 From: 5HT Date: Fri, 17 Jun 2022 17:56:01 +0300 Subject: [PATCH 26/37] 8.6.1 --- mix.exs | 2 +- src/fs.app.src | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 217e161..bd5df6a 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule FS.Mixfile do def project do [app: :fs, - version: "8.6.0", + version: "8.6.1", description: "FS Native Listener (Mac Windows Linux)", elixir: "~> 1.9", deps: deps(), diff --git a/src/fs.app.src b/src/fs.app.src index 4c9b9a3..ef4fb99 100644 --- a/src/fs.app.src +++ b/src/fs.app.src @@ -1,6 +1,6 @@ {application, fs, [{description, "FS Native Listener (Mac Windows Linux)"}, - {vsn, "8.6.0"}, + {vsn, "8.6.1"}, {registered, []}, {applications, [kernel,stdlib]}, {mod, { fs_app, []}}, From 646522a1672ee65255952498674432d1ebb4df06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=BD=A2=E0=BE=A3=E0=BD=98=E0=BC=8B=E0=BD=91=E0=BD=82?= =?UTF-8?q?=E0=BC=8B=E0=BD=A6=E0=BE=9F=E0=BD=BC=E0=BD=93=E0=BC=8B=E0=BD=94?= Date: Sat, 25 Jun 2022 21:40:38 +0300 Subject: [PATCH 27/37] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index eb4f47f..5495bdf 100644 --- a/LICENSE +++ b/LICENSE @@ -16,7 +16,7 @@ OR IN INVIDIVUAL MANNER. YOU CANNOT USE THIS SOFTWARE BY ANY MEANS IN INTEREST OF LEGAL ENTITIES OR INDIVIDUALS WHO IS SUPPORTING NOW OR WAS SUPPORTING -BACK THEN FASCISM, RUSCISM, COMMUNISM, CHOVINISM, HUMILIATION, +BACK THEN FASCISM, RUSCISM, COMMUNISM, CHAUVINISM, HUMILIATION, AND OTHER SUPPRESSIVE IDEOLOGIES IN DIFFERENT EXPRESSIONS. STOP KILLING UKRAINIANS, From 23a5b46b033437a3d69504811ae6c72f7704a78a Mon Sep 17 00:00:00 2001 From: zyuyou Date: Tue, 23 May 2023 01:03:25 +0800 Subject: [PATCH 28/37] fix relative path does not work on macOS --- src/fs.erl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/fs.erl b/src/fs.erl index 6ea2ffe..b8ea937 100644 --- a/src/fs.erl +++ b/src/fs.erl @@ -58,14 +58,21 @@ loop() -> loop(). find_executable(Cmd, DepsPath) -> - case priv_file(Cmd) of - false -> mad_file(DepsPath); - Priv -> Priv + Executable = + case priv_file(Cmd) of + false -> mad_file(DepsPath); + Priv -> Priv + end, + case filename:pathtype(Executable) of + relative -> + filename:join(path(), Executable); + _PathType -> + Executable end. mad_file(DepsPath) -> case filelib:is_regular(DepsPath) of - true -> path() ++ "/" ++ DepsPath; + true -> DepsPath; false -> case load_file(DepsPath) of {error, _} -> From 6d14422c2204e49f7eb8dc34b8953f0cb853aef2 Mon Sep 17 00:00:00 2001 From: Bruno Claudino Date: Tue, 4 Jun 2024 21:35:55 -0300 Subject: [PATCH 29/37] Update pc -> 1.15.0 --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 1b8e2f2..05c8abf 100644 --- a/rebar.config +++ b/rebar.config @@ -14,7 +14,7 @@ {"freebsd", "priv/kqueue", ["c_src/bsd/*.c"]} ]}. -{plugins, [pc, rebar3_hex]}. +{plugins, [{pc, "1.15.0"}]}. {provider_hooks, [ {pre, [ {compile, {pc, compile}}, From e2a87f32edb5fb9068c632c3f7e69e217a967f85 Mon Sep 17 00:00:00 2001 From: Bruno Claudino Date: Wed, 5 Jun 2024 10:38:16 -0300 Subject: [PATCH 30/37] ci: update otp and elixir version --- .github/workflows/elixir.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 6d3c66f..e72c2df 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -7,8 +7,8 @@ jobs: - uses: actions/checkout@v2 - uses: erlef/setup-elixir@v1 with: - otp-version: 23.x - elixir-version: 1.9.x + otp-version: '26' + elixir-version: 1.16.x - name: Dependencies run: | mix local.rebar --force From 6fb336858701fb41c85c024f1781590ed92ba84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A1=D0=BE=D1=85?= =?UTF-8?q?=D0=B0=D1=86=D1=8C=D0=BA=D0=B8=D0=B9?= Date: Fri, 21 Mar 2025 21:36:33 +0200 Subject: [PATCH 31/37] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 454062d..ef80875 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ FS: Native Listener (Mac Windows Linux) ======================================= [![Actions Status](https://github.com/synrc/fs/workflows/mix/badge.svg)](https://github.com/synrc/fs/actions) -[![Build Status](https://travis-ci.com/synrc/fs.svg?branch=master)](https://travis-ci.com/synrc/fs) [![Hex pm](http://img.shields.io/hexpm/v/fs.svg?style=flat)](https://hex.pm/packages/fs) Backends From 43c7970d861e1ff14cc3677789d9a536851b9da7 Mon Sep 17 00:00:00 2001 From: GH <47375452+VlkrS@users.noreply.github.com> Date: Mon, 31 Mar 2025 22:51:36 +0200 Subject: [PATCH 32/37] Use inotifywait for {Free,Open}BSD --- rebar.config | 4 +--- src/fs_sup.erl | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rebar.config b/rebar.config index 05c8abf..39a400a 100644 --- a/rebar.config +++ b/rebar.config @@ -10,9 +10,7 @@ {hex, [{doc, edoc}]}. {port_specs, - [{"darwin", "priv/mac_listener", ["c_src/mac/*.c"]}, - {"freebsd", "priv/kqueue", ["c_src/bsd/*.c"]} - ]}. + [{"darwin", "priv/mac_listener", ["c_src/mac/*.c"]}]}. {plugins, [{pc, "1.15.0"}]}. {provider_hooks, [ diff --git a/src/fs_sup.erl b/src/fs_sup.erl index 5709bec..1aa7e25 100644 --- a/src/fs_sup.erl +++ b/src/fs_sup.erl @@ -18,6 +18,8 @@ init([EventHandler, FileHandler, Path]) -> Backend = case os:type() of {unix, darwin} -> fsevents; {unix, linux} -> inotifywait; + {unix, freebsd} -> inotifywait; + {unix, openbsd} -> inotifywait; {unix, sunos} -> undefined; {unix, _} -> kqueue; {win32, nt} -> inotifywait_win32; From 7e6b432f40dc412f40e75288801345533694b0f8 Mon Sep 17 00:00:00 2001 From: 5HT Date: Tue, 1 Apr 2025 08:50:18 +0300 Subject: [PATCH 33/37] 11.4.1 --- LICENSE | 2 +- README.md | 1 + index.html | 6 +++--- mix.exs | 4 ++-- rebar.config | 1 + src/fs.app.src | 4 ++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index 5495bdf..d68229e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ DHARMA License -Copyright (c) 2015—2022 Synrc Research +Copyright (c) 2015—2025 Synrc Research Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/README.md b/README.md index ef80875..37fa11e 100644 --- a/README.md +++ b/README.md @@ -48,5 +48,6 @@ Credits * Vladimir Kirillov * Maxim Sokhatsky * Dominic Letz +* Dominic Letz OM A HUM diff --git a/index.html b/index.html index 43b72a5..0050f56 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@

FS

SYNOPSIS

FS is a native file system listener for Windows, Linux and Mac - which is using by both Elixir and Synrc communities.

+ which is using by both Elixir and Erlang communities.
$ mad get fs
@@ -30,8 +30,8 @@

MODULES


- NOV 2021 © proger ISC
- VER 7.11 6.1 4.10 + APR 2025 © proger ISC
+ VER 11.4.1 7.11 6.1
diff --git a/mix.exs b/mix.exs index bd5df6a..5e0bdbc 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule FS.Mixfile do def project do [app: :fs, - version: "8.6.1", + version: "11.4.1", description: "FS Native Listener (Mac Windows Linux)", elixir: "~> 1.9", deps: deps(), @@ -15,7 +15,7 @@ defmodule FS.Mixfile do defp package do [name: :fs, files: ["include", "priv", "src", "c_src", "LICENSE", "README.md", "rebar.config"], - maintainers: ["Vladimir Kirillov", "Namdak Tonpa"], + maintainers: ["Namdak Tonpa"], licenses: ["MIT"], links: %{"GitHub" => "https://github.com/synrc/fs"}] end diff --git a/rebar.config b/rebar.config index 39a400a..4c38d29 100644 --- a/rebar.config +++ b/rebar.config @@ -19,6 +19,7 @@ {clean, {pc, clean}} ]} ]}. + %{pre_hooks, [ % {"win32", compile, "make -f c_src/windows/Makefile"}, % {"win32", clean, "make -f c_src/windows/Makefile clean"} diff --git a/src/fs.app.src b/src/fs.app.src index ef4fb99..804c159 100644 --- a/src/fs.app.src +++ b/src/fs.app.src @@ -1,11 +1,11 @@ {application, fs, [{description, "FS Native Listener (Mac Windows Linux)"}, - {vsn, "8.6.1"}, + {vsn, "11.4.1"}, {registered, []}, {applications, [kernel,stdlib]}, {mod, { fs_app, []}}, {env, [ {backwards_compatible, true} ]}, - {maintainers,["Maxim Sokhatsky", "Vladimir Kirillov"]}, + {maintainers,["Maxim Sokhatsky"]}, {licenses, ["ISC"]}, {links,[{"Github","https://github.com/synrc/fs"}]} ]}. From ed53ca916da71c708b66ebcde0e2d25c2e24c64e Mon Sep 17 00:00:00 2001 From: 5HT Date: Tue, 1 Apr 2025 09:18:31 +0300 Subject: [PATCH 34/37] 11.4.1 --- mix.exs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mix.exs b/mix.exs index 5e0bdbc..503dcd4 100644 --- a/mix.exs +++ b/mix.exs @@ -8,7 +8,6 @@ defmodule FS.Mixfile do elixir: "~> 1.9", deps: deps(), docs: [], - compilers: [:rebar3], package: package()] end @@ -21,7 +20,6 @@ defmodule FS.Mixfile do end defp deps do - [{:ex_doc, "~> 0.11", only: :dev}, - {:mix_rebar3, "~> 0.1", runtime: false}] + [{:ex_doc, "~> 0.11", only: :dev}] end end From 61c298e4453aa94514de547f64b2b5e86a89c7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A1=D0=BE=D1=85?= =?UTF-8?q?=D0=B0=D1=86=D1=8C=D0=BA=D0=B8=D0=B9?= Date: Tue, 1 Apr 2025 09:21:10 +0300 Subject: [PATCH 35/37] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 37fa11e..ef80875 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,5 @@ Credits * Vladimir Kirillov * Maxim Sokhatsky * Dominic Letz -* Dominic Letz OM A HUM From 7ee5ecfcc968a78c156986dc608cee3fd3113135 Mon Sep 17 00:00:00 2001 From: 5HT Date: Tue, 1 Apr 2025 09:37:36 +0300 Subject: [PATCH 36/37] BSD --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 0050f56..c3c62cd 100644 --- a/index.html +++ b/index.html @@ -21,13 +21,15 @@

FS

SYNOPSIS

-
FS is a native file system listener for Windows, Linux and Mac +
FS is a native file system listener for Windows, BSD, Linux and Mac which is using by both Elixir and Erlang communities.

$ mad get fs

MODULES

-
+

APR 2025 © proger ISC
From bbe4ae94fb63d2b60cef4ae4cfe56978e3cabaae Mon Sep 17 00:00:00 2001 From: 5HT Date: Tue, 1 Apr 2025 09:40:48 +0300 Subject: [PATCH 37/37] UA Localization --- index.html | 2 +- man/fs.htm | 2 +- man/fs_app.htm | 2 +- man/fs_event_bridge.htm | 2 +- man/fs_server.htm | 2 +- man/fs_sup.htm | 2 +- man/fsevents.htm | 2 +- man/inotifywait.htm | 2 +- man/inotifywait_win32.htm | 2 +- man/kqueue.htm | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index c3c62cd..630025f 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ diff --git a/man/fs.htm b/man/fs.htm index bbe7a3e..1f5c4cb 100644 --- a/man/fs.htm +++ b/man/fs.htm @@ -12,7 +12,7 @@ diff --git a/man/fs_app.htm b/man/fs_app.htm index 9ca43e4..edfc43c 100644 --- a/man/fs_app.htm +++ b/man/fs_app.htm @@ -10,7 +10,7 @@ diff --git a/man/fs_event_bridge.htm b/man/fs_event_bridge.htm index 3b94090..befec06 100644 --- a/man/fs_event_bridge.htm +++ b/man/fs_event_bridge.htm @@ -11,7 +11,7 @@ diff --git a/man/fs_server.htm b/man/fs_server.htm index ddd6012..3745929 100644 --- a/man/fs_server.htm +++ b/man/fs_server.htm @@ -11,7 +11,7 @@ diff --git a/man/fs_sup.htm b/man/fs_sup.htm index 93025e7..9099b4b 100644 --- a/man/fs_sup.htm +++ b/man/fs_sup.htm @@ -11,7 +11,7 @@ diff --git a/man/fsevents.htm b/man/fsevents.htm index e99f938..d5c86c1 100644 --- a/man/fsevents.htm +++ b/man/fsevents.htm @@ -11,7 +11,7 @@ diff --git a/man/inotifywait.htm b/man/inotifywait.htm index 586a499..a0d5444 100644 --- a/man/inotifywait.htm +++ b/man/inotifywait.htm @@ -11,7 +11,7 @@ diff --git a/man/inotifywait_win32.htm b/man/inotifywait_win32.htm index 77c272a..5508f8f 100644 --- a/man/inotifywait_win32.htm +++ b/man/inotifywait_win32.htm @@ -11,7 +11,7 @@ diff --git a/man/kqueue.htm b/man/kqueue.htm index 715d881..4cb0a1a 100644 --- a/man/kqueue.htm +++ b/man/kqueue.htm @@ -11,7 +11,7 @@