I am experiencing the same problem. This bug is reported in 2010 and
unfortunately not resolved.

Emmanuel,
I've tried to contact you at kol...@debian.org, but with no luck. If you
read this, please let us know if there's any chance you can fix this?
Thanks in advance!

For others out there who have to deal with watched directories with spaces,
here is a little workaround for you that I use myself. As far as I'm
concerned this works flawlessly.


For instance, when you watch a directory like this:
/home/gerard/test\ dir\ with\ spaces/
IN_CREATE,IN_MOVED_TO,IN_DELETE,IN_MOVED_FROM,IN_CLOSE_WRITE
/home/gerard/incronscript.sh $% $# $@

I have put the 'watched directory' argument ($@) as last argument. Then in
my script I use this syntax to reproduce the directory including spaces:


#! /bin/bash
i=3
while [ $i -le $# ]
do
DIR="$DIR${!i}"
if [ $i -lt $# ] ; then DIR="$DIR " ; fi
i=$(( $i + 1 ))
done
echo -e "FLAGS \t\t: \t$1"
echo -e "FILE/DIR \t: \t$2"
echo -e "Watched PATH \t: \t$DIR"


This will produce output something like this:
FLAGS : IN_MOVED_TO,IS_DIR
FILE/DIR : Test_file.txt
Watched PATH : /home/gerard/test dir with spaces/


Of course you can also use:
DIR="$DIR\ "
if you want the reproduces path to be like:
/home/gerard/test\ dir\ with\ spaces/

Reply via email to