inotify �� Android ��Υե����� I/O ��ƻ뤹��
Android �� Linux �����ͥ�ˤ� inotify ���ޤޤ�Ƥ��ꡢAndroid SDK �ˤ� inotify �����Ѥ��� FileObserver ���饹���Ѱդ���Ƥ��ޤ���
Android �Ǥϰ��̤Υ��ץꥱ�������ץ��������饢�������Ǥ���ե����롦�ǥ��쥯�ȥ꤬���¤���뤿�ᡢFileObserver ��Ȥ� Android ���ץ�η��ǥġ�����Ѱդ��Ƥ⺣�����Ū�ˤϤ��ޤ����Ω���ʤ��Ǥ��礦�������������ˤ� CUI �Υ��ޥ�ɥ饤��ġ��������������ͻ�̤������ޤ���Android ���ߥ�졼���Ķ��ؤ� adb shell ��³�������� root ���¤Υ��󥽡����ǥġ����ư�������Ȥˤ��ޤ�����
Android �� notify ���ޥ�ɤ�Ȥ�
Android �ˤ� inotify API ��Ȥäƥե����� I/O ���˥����륳�ޥ�ɥ饤��ġ����notify�פ��ޤޤ�Ƥ��ޤ��� [platform/system/core/toolbox/notify.c]
# notify Usage: notify [-m eventmask] [-c count] [-p] [-v verbosity] path [path ...]���� notify ���ޥ�ɤ�Ȥä� "/data/local/tmp" �ǥ��쥯�ȥ��ƻ뤷�Ĥ��̥ץ���������ʲ��Υ��ޥ�ɤ�¹Ԥ������ν�����򼨤��ޤ���
# pwd /data/local/tmp # echo aaa > test.txt # mv test.txt aaa.txt
# notify -c 10 /data/local/tmp /data/local/tmp: 00000100 00000000 "test.txt" ; 0x00000100:IN_CREATE /data/local/tmp: 00000020 00000000 "test.txt" ; 0x00000020:IN_OPEN /data/local/tmp: 00000002 00000000 "test.txt" ; 0x00000002:IN_MODIFY /data/local/tmp: 00000008 00000000 "test.txt" ; 0x00000008:IN_CLOSE_WRITE /data/local/tmp: 00000040 00000033 "test.txt" ; 0x00000040:IN_MOVED_FROM /data/local/tmp: 00000080 00000033 "aaa.txt" ; 0x00000080:IN_MOVED_TO�� I/O ���٥�Ȥ������ [platform/bionic/libc/kernel/common/linux/inotify.h]
inotifywait ���ޥ�ɤ�Ȥ�
Android �� notify ���ޥ�ɤϥ���ѥ��ȤǼ�ڤʥġ���Ǥ��������Ϥ��ɤߤˤ����˲ä����ǥ��쥯�ȥ��۲���Ƶ�Ū�˴ƻ�Ǥ��ʤ��������ؤǤ�����¤������ġ���򼫺��Τ����򤽤��ǤϤ���ޤ�����Linux �����ˤ� inotify-tools �Ȥ����ѥå����������뤳�Ȥ��Τꡢ�����˴ޤޤ�� inotifywait ���ޥ�ɤ����Ѥ��뤳�Ȥˤ��ޤ�����
���Ǥ�ï���� Android ���ư��� inotifywait ��ӥ�ɤ����ۤ��Ƥ���ΤǤϤʤ����ȥͥåȾ��õ�����Ȥ�����������ʤ��ä�����긵�ǥӥ�ɤ�Ԥ��ޤ�����inotifywait ���Τ� NDK �ǤΥӥ���Ѥ˼��ä����ץ��������Ȱ켰��ʲ��˸������ޤ���
md5sum [55BF0FD8365A4139D679CE0D6A3A07B3]
�ץ��������Ȱ켰�ʢ��� - github
�ʢ��� �ʲ�������ʪ���ޤޤ�ޤ������Ѥ˺ݤ��Ƥϳƥ��եȥ������Υ饤���󥹵�����餷�Ʋ��������� inotify-tools
����ԡ�Rohan McGovern, Radu Voicilas
�饤���󥹡�GPL version 2
�����ȡ�https://github.com/rvoicilas/inotify-tools/wiki/
�� GNU glibc POSIX ����ɽ���ؿ��� (glibc-2.11.3 ���)
����ԡ�Free Software Foundation, Inc.
�饤���󥹡�LGPL version 2.1 or later
�����ȡ�http://www.gnu.org/software/libc/
inotifywait �� /data /cache /system �γƥǥ��쥯�ȥ��Ƶ�Ū�˴ƻ뤵�������֤ǡ�����Υ��ץ��HelloApp�פ�ư�����ݤν������ʲ��˼����ޤ���
# ./inotifywait -r -m /data /cache /system Setting up watches. Beware: since -r was given, this may take a while! Watches established. /system/framework/ ACCESS framework-res.apk /system/framework/ ACCESS framework-res.apk /data/app/ OPEN com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ OPEN com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/dalvik-cache/ OPEN data@[email protected]@classes.dex /data/dalvik-cache/ ACCESS data@[email protected]@classes.dex /data/dalvik-cache/ ACCESS data@[email protected]@classes.dex /data/app/ OPEN com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /data/app/ ACCESS com.example.helloapp-1.apk /system/framework/ ACCESS framework-res.apk /data/app/ ACCESS com.example.helloapp-1.apk /system/fonts/ OPEN DroidSans-Bold.ttf /system/lib/hw/ OPEN gralloc.default.so /system/lib/hw/ ACCESS gralloc.default.so /system/lib/hw/ ACCESS gralloc.default.so /system/framework/ ACCESS framework-res.apk /system/framework/ ACCESS framework-res.apk /data/app/ CLOSE_NOWRITE,CLOSE com.example.helloapp-1.apk :
(tanabe)