yLinuxzƒJ[ƒlƒ‹‘ ..
527:login:Penguin
07/04/27 21:53:32 8003YhUG
‚¿‚å‚Á‚ÆŽ¿–â‚È‚ñ‚Å‚·‚ªinotify‚ð—˜—p‚µ‚悤‚Æ‚¿‚傱‚¿‚傱‚Á‚ƃTƒ“ƒvƒ‹‚ð‘‚¢‚Ă݂½‚̂ł·‚ªA
“®ìŽd—l‚ª‚Ç‚¤‚É‚à—‰ð‚ɋꂵ‚݂܂·B‰º‚̂悤‚ÉAƒ‹[ƒv‚Åread‚µ‚ăuƒƒbƒLƒ“ƒO‚·‚邯Aʼn‚̈ê‰ñ‚¾‚¯‚Íread‚·‚é‚̂ł·‚ªA2‰ñ–ÚˆÈ~–³”½‰ž‚ɂȂÁ‚Ä‚µ‚Ü‚¢‚Ü‚·B
/* size of the event structure, not counting name */
#define EVENT_SIZE (sizeof (struct inotify_event))
/* reasonable guess as to size of 1024 events */
#define BUF_LEN (1024 * (EVENT_SIZE + 16)
char buf[BUF_LEN];
int len, i = 0;
int fd = inotify_init();
int wd = inotify_add_watch(fd, "/usr/local/hoge", IN_ACCESS | IN_MODIFY);
while(1){
len = read (fd, buf, BUF_LEN);
}
ŽŸƒy[ƒW‘±‚«‚ð•\ަ1‚ð•\ަÅVƒŒƒX•\ަƒXƒŒƒbƒh‚ÌŒŸõ—ÞŽ—ƒXƒŒˆê——˜b‘è‚̃jƒ…[ƒX‚¨‚Ü‚©‚¹ƒŠƒXƒg¥ƒIƒvƒVƒ‡ƒ“‚ð•\ަ‰É‚‚Ԃµ2ch
5393“ú‘O‚ÉXV/123 KB
’S“–:undef