<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>EMSTONE Bebop &#187; Inotify</title>
	<atom:link href="http://bebop.emstone.com/tags/inotify/feed/" rel="self" type="application/rss+xml" />
	<link>http://bebop.emstone.com</link>
	<description>엠스톤 개발팀 블로그</description>
	<lastBuildDate>Sun, 29 Jan 2012 05:25:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/kr/</creativeCommons:license>
		<item>
		<title>inotify 를 이용한 파일 시스템 감시</title>
		<link>http://bebop.emstone.com/2008/12/28/monitoring-filesystem-with-inotify/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=monitoring-filesystem-with-inotify</link>
		<comments>http://bebop.emstone.com/2008/12/28/monitoring-filesystem-with-inotify/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 10:24:19 +0000</pubDate>
		<dc:creator>lethean</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Inotify]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://bebop.emstone.com/?p=300</guid>
		<description><![CDATA[inotify 는 커널 2.6.13 이후 버전에서 사용가능하며 파일시스템의 접근, 변경, 삭제등의 동작을 알려주는 기능을 수행합니다. 모니터링 시스템에서 유용하게 사용가능하며 이벤트 감지의 통보를 파일시스템의 파일에 저장하며 바로 이벤트를 감지할 수 있으므로 다른 응용에도 사용 가능할 것으로 보입니다. 위키 백과 사전에도 설명되어 &#8230; <a href="http://bebop.emstone.com/2008/12/28/monitoring-filesystem-with-inotify/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>inotify 는 커널 2.6.13 이후 버전에서 사용가능하며 파일시스템의 접근, 변경, 삭제등의 동작을 알려주는 기능을 수행합니다.<br />
모니터링 시스템에서 유용하게 사용가능하며 이벤트 감지의 통보를 파일시스템의 파일에 저장하며 바로 이벤트를 감지할 수 있으므로 다른 응용에도 사용 가능할 것으로 보입니다.</p>
<p><a href="http://ko.wikipedia.org/wiki/Inotify">위키 백과 사전</a>에도 설명되어 있듯이  3가지 api 를 지원합니다.</p>
<ul>
<li>int inotify_init ()</li>
<li>int inotify_add_watch (int fd, const char* pathname, int mask)</li>
<li>nt inotify_rm_watch (int fd, int wd)</li>
</ul>
<p>간단한 사용예는 다음과 같습니다.</p>
<pre>#include &lt;sys/inotify.h&gt;

#define EVENT_SIZE  ( sizeof (struct inotify_event) )
#define BUF_LEN     ( 1024 * ( EVENT_SIZE + 16 ) )

int main( int argc, char **argv )
{
  int fd, wd;
  struct inotify_event *event;

  fd = inotify_init();
  wd = inotify_add_watch(fd, "/home/jklee3", IN_MODIFY | IN_CREATE | IN_DELETE );

  read( fd, buffer, BUF_LEN );

  event = ( struct inotify_event * ) &amp;buffer[0];

  if ( event-&gt;mask &amp; IN_CREATE ) {
    if ( event-&gt;mask &amp; IN_ISDIR )
      printf( "The directory %s was created.\n", event-&gt;name );
    else
      printf( "The file %s was created.\n", event-&gt;name );
  }

  if ( event-&gt;mask &amp; IN_DELETE ) {
    if ( event-&gt;mask &amp; IN_ISDIR )
      printf( "The directory %s was deleted.\n", event-&gt;name );
    else
      printf( "The file %s was deleted.\n", event-&gt;name );
  }

  if ( event-&gt;mask &amp; IN_MODIFY ) {
    if ( event-&gt;mask &amp; IN_ISDIR )
      printf( "The directory %s was modified.\n", event-&gt;name );
    else
      printf( "The file %s was modified.\n", event-&gt;name );
  }

  inotify_rm_watch( fd, wd );
  close( fd );

  return 0;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://bebop.emstone.com/2008/12/28/monitoring-filesystem-with-inotify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/kr/</creativeCommons:license>
	</item>
	</channel>
</rss>

