Code Monkey home page Code Monkey logo

emcrisostomo / fswatch Goto Github PK

View Code? Open in Web Editor NEW
4.9K 104.0 326.0 14.92 MB

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.

Home Page: https://emcrisostomo.github.io/fswatch/

License: GNU General Public License v3.0

Shell 1.54% C++ 56.25% C 12.20% Makefile 2.70% M4 24.41% CMake 2.91%
event-notifications change-monitor fswatch kqueue inotify solaris c c-plus-plus

fswatch's Issues

Get file that changed?

Can fswatch tell me which file in a directory changed? I want to use it to copy files on update as a backup, but I want to know which file to copy. Thanks.

multiple folders not working on Mavericks

Sorry I can't leave a more detailed description of what's going on, as I'm not as experienced with C.

I can start fswatch in a certain directory with fswatch app "echo hello", and on another directory in the same parent directory with fswatch test "echo hello". However, fswatch test:app "echo hello" does not echo "hello" for edits in either folder.

Could this be an issue with CFStringCreateWithCString or CFStringCreateArrayBySeparatingStrings (lines 65-66)?

Functional changes for version > 0.0.2

I just upgraded by Homebrews and got a new fswatch that works totally differently than before. OK, I can see a point in working more like inotifywatch, but the old API was very useful for me. How about adding a compatibility mode to run some command whenever an event occurs? Maybe something like

fswatch --execute ./do-stuff.sh dir1 dir2 ...

Ignoring some files?

Hi

Would it be possible to specify a list of files to ignore? Typical use case: avoiding re-running the unit tests when vim's swap file changes.
Thanks for the work so far!

Add option: --include [regex]

This could be useful in the case that you want to watch for files of a specific type being changed or created, for example:

fswatch src --include '\.coffee$'

If you attempt to achieve this with the following command:

fswatch src/*.coffee

then only changes to .coffee files that exist at the time of calling fswatch will be detected—since the shell expands the glob in the argument, new files won’t be detected.

@emcrisostomo has suggested that until this feature is added, the desired behaviour can be achieved with grep:

fswatch -0 src | while read -d "" i
do
  if echo $i | grep -q "\.coffee$" > /dev/null ; then
    // do something
  fi
done

Update man page

Man page has been merged from fsw where every reference to fsw has been substituted with a reference to fswatch. However, the man page should be review and documentation about all the monitors should be updated (the inotify monitor is missing altogether).

Add verbose mode

This allows developers to debug why, for example the script invokes the action twice.

Unable to build source

If I clone your repository there's no configure script. Running autoconf fails as well due to missing dependencies.

watch a file?

Nice!

Would it be possible to watch a single file instead of a complete directory?

cheers
Mark

MINOR issue; suggestion, even.

Just a suggestion: add an example using xargs, not read, and point out the importance of using -n 1 with it, i.e. fswatch . -0 | xargs -0 -n 1 sshOrWhatever. I couldn't find such an example in your documentation (though it might be in there), and I know a few people who have struggled with this.

Have monitor exit when -1/--one-shot is used instead of using ::exit().

A patch has been applied that makes fsw exit using ::exit() after the first even is notified when the -1/--one-shot option is used. Monitor cleanup is performed using a function registered with ::atexit(), but in this simple case I believe a better solution would be having the monitor exit from the run loop to have main() return instead of terminating the process with ::exit().

broken fswatch-run symlink installed if using DESTDIR=...

If installing using make install DESTIR=... the fswatch-run symlink incorrectly points into the destdir.

The fix is to remove $(DESTDIR) from the source part when creating the symlink.

In fact since the source and destination are in the same directory there's no need to use the absolute path at all.

This patch should fix this:

--- Makefile.am.orig    2014-09-04 05:24:39.000000000 -0500
+++ Makefile.am 2014-09-07 19:59:51.000000000 -0500
@@ -37,10 +37,10 @@

 install-exec-hook: fswatch-remove-links
 if HAVE_ZSH
-   $(LN_S) $(DESTDIR)$(bindir)/fswatch-run-zsh $(DESTDIR)$(bindir)/fswatch-run
+   $(LN_S) fswatch-run-zsh $(DESTDIR)$(bindir)/fswatch-run
 else
 if HAVE_BASH
-   $(LN_S) $(DESTDIR)$(bindir)/fswatch-run-bash $(DESTDIR)$(bindir)/fswatch-run
+   $(LN_S) fswatch-run-bash $(DESTDIR)$(bindir)/fswatch-run
 else
    @echo "No compatible shell was found for fswatch-run."
 endif

support file-content change watching

Many times an application is interested not in the fact that the modified date changed, but that the actual content of the file changed.

Obviously this does not apply to directories, and adds a whole new set of edge cases to deal with. Is this something which makes sense as part of fswatch, or should it be a separate tool?

Handle monitor queue overflows.

Both the Windows and the Linux inotify monitor internal buffers may overflow if events are generated too quickly. Currently, fswatch exits with an error. I'd like to add an option to have fswatch emit a placeholder event for queue overflows without exiting, so that callers may gracefully recover.

Build fails on Ubuntu 14.04.1 LTS

$ autoconf
configure.ac:31: error: possibly undefined macro: AC_CONFIG_MACRO_DIRS
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:45: error: possibly undefined macro: AM_INIT_AUTOMAKE
configure.ac:46: error: possibly undefined macro: AM_SILENT_RULES
configure.ac:47: error: possibly undefined macro: AM_PROG_AR
configure.ac:59: error: possibly undefined macro: AM_GNU_GETTEXT
configure.ac:60: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
configure.ac:71: error: possibly undefined macro: AM_CONDITIONAL

$ cat /etc/issue
Ubuntu 14.04.1 LTS \n \l

$ autoconf -V
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
http://gnu.org/licenses/gpl.html, http://gnu.org/licenses/exceptions.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

Freebsd gettext version

Running Freebsd.

in ./configure.ac and ./libfswatch/configure.ac there is a dependency on gettext 0.19.2 . Latest package / port available in Freebsd is currently 0.18.3 . Any special need for 0.19.2 instead of 0.18.3 ?

Documentation for fswatch?

I'm trying to convert an inotifywait to fswatch so that I can also use it on a Mac. The command I'm trying to convert is:

inotifywait -r -m 'my_folder/' | while read MODFILE
// etc

Following the example in the README, I created a folder called testfswatch/ and I tried running the following commands in the parent folder and then adding and changing files on the testfswatch/ folder:

fswatch -o testfswatch/ | echo "LALA"
fswatch -o testfswatch/ | someSimpleProgram
fswatch -o testfswatch/ | xargs -n1 -I{} echo "LALA"
fswatch -o testfswatch/ | xargs -n1 -I{} ./someExecutable

None of these commands seem to do anything when I change or add files in the tesfswatch/ folder though.

Does anybody know what I'm doing wrong here? All tips are welcome!

All tips are welcome!

License?

I can't find information on program's license. Could you add one in a LICENSE file or in a file comment?

Add watch filters to prevent action being invoked twice

I'm fswatch to watch my unit tests and source code directories run some tests automatically on file change. This works fairly well, but every modification I seem to make causes two events. I'm guessing this is

  • one for the modified file
  • one for the directory

This is undesirable and inconvenient.

fswatch broken on OS X 10.10 Yosemite

After upgrading from OS X 10.9 to 10.10, fswatch doesn't work for me anymore, i.e. it doesn't report file changes anymore. I installed it via homebrew, brew updated, brew doctord, and all is fine. I updated XCode, brew uninstall fswatchd and reinstalled it after the OS upgrade, too, but it just doesn't report file changes anymore.

I feel quite stupid reporting this issue without any further information, but I'm not sure where to start. Are there other ways besides fswatch -v (tells me that SIGTERM, SIGABRT and SIGINT handler have been registered) to debug? Are there dependencies that I should check?

problems building on ubuntu

It seems to build without any errors, but when running it, it fails to find libfswatch.so.0:

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for clang++... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether ln -s works... yes
checking for zsh... no
checking for bash... /bin/bash
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking CXXFLAGS for maximum warnings... -Wall
checking for stdlib.h... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for working strtod... yes
checking for getopt_long... yes
checking for realpath... yes
checking for regcomp... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating scripts/fswatch-run-bash
config.status: creating scripts/fswatch-run-zsh
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in libfswatch (/home/slang/pkgs/fswatch-1.4.2/libfswatch)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for clang++... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking CXXFLAGS for maximum warnings... -Wall
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking CoreServices/CoreServices.h usability... no
checking CoreServices/CoreServices.h presence... no
checking for CoreServices/CoreServices.h... no
checking unordered_map usability... yes
checking unordered_map presence... no
configure: WARNING: unordered_map: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: unordered_map: proceeding with the compiler's result
checking for unordered_map... yes
checking unordered_set usability... yes
checking unordered_set presence... no
configure: WARNING: unordered_set: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: unordered_set: proceeding with the compiler's result
checking for unordered_set... yes
checking mutex usability... yes
checking mutex presence... no
configure: WARNING: mutex: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: mutex: proceeding with the compiler's result
checking for mutex... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for size_t... yes
checking for uint32_t... yes
checking for mode_t... yes
checking for struct stat.st_mtime... yes
checking for struct stat.st_mtimespec... no
checking for std::unique_ptr<std::string>... yes
checking for realpath... yes
checking for modf... yes
checking for regcomp... yes
checking whether kqueue is declared... no
checking whether kevent is declared... no
checking for thread_local storage specifier... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libfswatch_config.h
config.status: executing depfiles commands
config.status: executing libtool commands

$ make
make  all-recursive
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
Making all in libfswatch
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make  all-am
make[3]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
  CXX      c/libfswatch.lo
  CXX      c/libfswatch_log.lo
  CXX      c++/libfswatch_exception.lo
  CXX      c++/event.lo
  CXX      c++/monitor.lo
  CXX      c++/poll_monitor.lo
  CXX      c++/inotify_monitor.lo
  CXX      c++/path_utils.lo
  CXXLD    libfswatch.la
make[3]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
  CXX      fswatch.o
  CXX      fswatch_log.o
  CXXLD    fswatch
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'

$ make check
Making check in libfswatch
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'

$ sudo make install
Making install in libfswatch
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libfswatch.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libfswatch.so.0.0.0 /usr/local/lib/libfswatch.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libfswatch.so.0.0.0 libfswatch.so.0 || { rm -f libfswatch.so.0 && ln -s libfswatch.so.0.0.0 libfswatch.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libfswatch.so.0.0.0 libfswatch.so || { rm -f libfswatch.so && ln -s libfswatch.so.0.0.0 libfswatch.so; }; })
libtool: install: /usr/bin/install -c .libs/libfswatch.lai /usr/local/lib/libfswatch.la
libtool: install: /usr/bin/install -c .libs/libfswatch.a /usr/local/lib/libfswatch.a
libtool: install: chmod 644 /usr/local/lib/libfswatch.a
libtool: install: ranlib /usr/local/lib/libfswatch.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/share/doc/libfswatch'
 /usr/bin/install -c -m 644 README.md AUTHORS COPYING LICENSE NEWS '/usr/local/share/doc/libfswatch'
 /bin/mkdir -p '/usr/local/include/libfswatch/c'
 /usr/bin/install -c -m 644 c/libfswatch.h c/cevent.h c/cfilter.h c/cmonitor.h c/error.h '/usr/local/include/libfswatch/c'
 /bin/mkdir -p '/usr/local/include/libfswatch/c++'
 /usr/bin/install -c -m 644 c++/monitor.h c++/inotify_monitor.h c++/poll_monitor.h c++/filter.h c++/event.h c++/libfswatch_exception.h '/usr/local/include/libfswatch/c++'
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
 /bin/mkdir -p '/usr/local/bin'
  /bin/bash ./libtool   --mode=install /usr/bin/install -c fswatch '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/fswatch /usr/local/bin/fswatch
 /bin/mkdir -p '/usr/local/bin'
 /usr/bin/install -c scripts/fswatch-run-bash scripts/fswatch-run-zsh '/usr/local/bin'
make  install-exec-hook
make[3]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
rm /usr/local/bin/fswatch-run
ln -s /usr/local/bin/fswatch-run-bash /usr/local/bin/fswatch-run
make[3]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'
 /bin/mkdir -p '/usr/local/share/doc/fswatch'
 /usr/bin/install -c -m 644 README.bsd README.freebsd README.gnu-build-system README.md README.osx AUTHORS COPYING LICENSE NEWS '/usr/local/share/doc/fswatch'
 /bin/mkdir -p '/usr/local/share/man/man7'
 /usr/bin/install -c -m 644 fswatch.7 '/usr/local/share/man/man7'
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'

$ fswatch
fswatch: error while loading shared libraries: libfswatch.so.0: cannot open shared object file: No such file or directory

Problems building fswatch 1.3.6 on Mac v10.8.5

I just downloaded the 1.3.6 release and tried to configure and make, but I get the error below. Anything special I should feed into configure and/or make?
(Sorry about the crappy formatting :( )

make  all-am
clang++ -DHAVE_CONFIG_H -I.     -g -O2 -std=c++11 -Wall -MT fsevent_monitor.o -MD -MP -MF .deps/fsevent_monitor.Tpo -c -o fsevent_monitor.o fsevent_monitor.cpp
fsevent_monitor.cpp:34:38: error: no matching constructor for initialization of 'const vector<FSEventFlagType>'
static const vector<FSEventFlagType> event_flag_type = {
                                     ^                 ~
/usr/include/c++/4.2.1/bits/stl_vector.h:255:9: note: candidate constructor template not viable: requires at most 3 arguments, but 20 were provided
        vector(_InputIterator __first, _InputIterator __last,
        ^
/usr/include/c++/4.2.1/bits/stl_vector.h:201:7: note: candidate constructor not viable: allows at most single argument '__a', but 20 arguments were provided
      vector(const allocator_type& __a = allocator_type())
      ^
/usr/include/c++/4.2.1/bits/stl_vector.h:213:7: note: candidate constructor not viable: requires at most 3 arguments, but 20 were provided
      vector(size_type __n, const value_type& __value = value_type(),
      ^
/usr/include/c++/4.2.1/bits/stl_vector.h:231:7: note: candidate constructor not viable: requires single argument '__x', but 20 arguments were provided
      vector(const vector& __x)
      ^
1 error generated.
make[1]: *** [fsevent_monitor.o] Error 1
make: *** [all] Error 2

Execute Command Only After All IO Operations are Completed

./fswatch /somedir "echo modified"
this command execute echo modified when ever /somedir is changed but the problem is
the command is not aware of IO Operations for an example
if im copying a 300MB File to /somedir the command "echo modified" is being executed several times
modify the tool to wait until the copy operation to fully complete then execute after

Ignore while command is running?

Would it be possible to (optionally) ignore new events while the specified command is running. In the case where the command outputs to the watched directory, this currently created an infinite loop.

Running a command with it's own arguments

Not sure this is the right place to ask, but Stackoverflow didn't come through http://stackoverflow.com/questions/25689589/how-to-run-fswatch-to-call-a-program-with-static-arguments

Basically, I used to use fswatch (0.0.2) like so:

fswatch . 'python manage.py test'

That ran the command python with the two arguments manage.py and test

Since upgrading fswatch I can't figure out a way to run my simple command without writing it into a bash script and then running that. Is there a way to do it? If so, I think it'd be a good thing to add to the wiki / readme - I can't be the only one stuck on this..

Get fswatch included with homebrew

It would be awesome if homebrew included the ability to install fswatch. I'm not sure how you go about getting a package added to the homebrew repository, but if you did then users with homebrew could install fswatch with:

brew install fswatch

Thanks for a great utility!

Watch a directory containing aliases?

Thank you for sharing this!

I have a directory of aliases pointing to files in other directories. Right now any changes to the target file do not trigger an event in the directory containing the alias.

What would be a good way to implement this in fswatch or otherwise?

Cheers :)

configure error line 2386: syntax error near unexpected token `m4'

After autogen.sh without any warning or error,

fswatch# ./configure
./configure: line 2386: syntax error near unexpected token `m4'
./configure: line 2386: `AC_CONFIG_MACRO_DIRS(m4)'

OS: CentOS release 5.8 (Final) x86_64
Autoreconf: autoreconf (GNU Autoconf) 2.69

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.