Page 1 of 2
File Observer - files in sub-folders not triggering
Posted: 06 Nov 2016 16:25
by ewill
I am using a File Observer trigger, which works perfectly at the "root" level (/storage/emulated/0), however when I observe in a subfolder, the trigger does not occur.
My test case is to use a shell script to create the file (echo test > test.txt). I have the "writable file closed" checkbox checked. When I create the file in the root, the trigger fires, but when I do the same in a subfolder, the trigger does not fire.
Any ideas?
I am running CM13 on an LG G4.
Re: File Observer - files in sub-folders not triggering
Posted: 07 Nov 2016 20:03
by Martin
Hi,
The trigger seems to work for me (Nexus 5X Android 7.1 and on a Nexus 7 with CM13). I used the working directory /storage/emulated/0/Alarms to write the test.txt file.
Are you sure that the file is written in the correct folder?
Regards,
Martin
Re: File Observer - files in sub-folders not triggering
Posted: 08 Nov 2016 00:15
by ewill
I am 100% sure that I am checking the correct file/folder.
I test.txt
-works in /storage/emulated/0/text.txt
-doesn't work in /storage/emulated/0/android/text.txt
-doesn't work in /storage/emulated/0/automagic/text.txt
-doesn't work in /storage/emulated/0/automagic/watch/text.txt
I use the file picker to select the file in the correct folder. I also see that the timestamp on the file has been updated.
I wonder what it could possibly be since it is working for you.
Re: File Observer - files in sub-folders not triggering
Posted: 08 Nov 2016 19:36
by Martin
Please try to reboot the device and see if this helps.
Could you please send the flow(s) to me so I can check with the exact same settings? Please send to
info@automagic4android.com.
Regards,
Martin
Re: File Observer - files in sub-folders not triggering
Posted: 08 Nov 2016 19:43
by ewill
I have rebooted the device. I have sent the flow to you (it is quite simple).
Thank you very much for the help
Re: File Observer - files in sub-folders not triggering
Posted: 08 Nov 2016 20:10
by Martin
Does it work when you observe the entire directory in the trigger File Observer? Event 'Writable file closed' seems not to work when the text file itself is monitored.
Regards,
Martin
Re: File Observer - files in sub-folders not triggering
Posted: 08 Nov 2016 20:22
by ewill
Just to make sure I understand properly, I set the path to:
'/storage/emulated/0/android/Automagic/watch' - that is the file that contains the one I am checking
then I am monitor "writable file closed"
Unfortunately, that is not working.
Just for kicks, I also selected the "file accessed" and "File opened" events as well.
My trigger still is not reacting.
Thanks again for the help.
Re: File Observer - files in sub-folders not triggering
Posted: 08 Nov 2016 20:39
by Martin
Yes, that's what I meant.
The trigger also works on CM13 for me in both cases, when watching the folder and when watching the file. Is there any app/tool installed on your device that could prevent such things from working? Maybe some kind privacy tool?
Re: File Observer - files in sub-folders not triggering
Posted: 08 Nov 2016 20:47
by ewill
I don't have any sort of privacy tool. I have adaway, but that should just monitor proxies. The only app that I am aware that would monitor folders is FolderSync, but I am not monitoring the folder in question.
This is a real head scratcher.
Re: File Observer - files in sub-folders not triggering
Posted: 12 Nov 2016 09:21
by rainscho
Hi.
I am observing the more or less same problem. An identical file-observer-trigger worked on 4 devices without any problems until a few days ago. Now, it is still working on 3 devices, but on the 4th one any longer, even if the path is changed to the root folder. I have now checked it on a 5th device, and here it doesn't work either.
I have no plan when the behaviour changed on the 4th device, what the 4th and the 5th have in common but is different on 1st, 2nd and 3rd.
I have installed Google Drive Sync, but on all 5 devices and not observing the root folder, but in fact it is observing the same folder the file observer trigger is observing.
Confused!
I will build a work-around with Google Drive Sync notification and a file-exist-condition, but of course it would be much smoother with a file-observer-trigger.