<blockquote>
<p>I'm not sure if GFileMonitor supports recursive directory monitoring, so it may not even be possible to do what I was hoping simply enough,...</p>
</blockquote>
<p>I implemented an automatic live update in the workbench plugin in PR <a href="https://github.com/geany/geany-plugins/pull/695" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="298022004" data-permission-text="Issue title is private" data-url="https://github.com/geany/geany-plugins/issues/695">#695</a>. I can say that it requires a bit effort because recursive directory monitoring is not possible. That means you have to generate a file monitor for each directory and each sub-directory contained in it.</p>
<p>Also a manual re-scan is required sometimes. Let's assume the following situation of existing files and directories:</p>
<ul>
<li>dir1
<ul>
<li>file1.1</li>
<li>file1.2</li>
</ul>
</li>
<li>dir2
<ul>
<li>file2.1</li>
<li>file2.2</li>
</ul>
</li>
</ul>
<p>Now someone copies in a new directory with 2 files in it, so the filesystem would look like this:</p>
<ul>
<li>dir1
<ul>
<li>file1.1</li>
<li>file1.2</li>
</ul>
</li>
<li>dir2
<ul>
<li>file2.1</li>
<li>file2.2</li>
</ul>
</li>
<li>dir3
<ul>
<li>file3.1</li>
<li>file3.2</li>
</ul>
</li>
</ul>
<p>The file monitoring will only notify you about the new filepath for dir3. But you need to re-scan the directory on that event to also recognizes the files contained in it (and of course create a new file monitor for it to be notified of future changes in dir3).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/issues/332#issuecomment-366459919">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ7Tqj16H6NpuCocv69W5naaf7ybqks5tVxVGgaJpZM4HEiGW">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ_9TM9mWmdWhE8IBuWKxRuVInrLRks5tVxVGgaJpZM4HEiGW.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany-plugins/issues/332#issuecomment-366459919"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany-plugins","title":"geany/geany-plugins","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany-plugins"}},"updates":{"snippets":[{"icon":"PERSON","message":"@LarsGit223 in #332: \u003e I'm not sure if GFileMonitor supports recursive directory monitoring, so it may not even be possible to do what I was hoping simply enough,...\r\n\r\nI implemented an automatic live update in the workbench plugin in PR #695. I can say that it requires a bit effort because recursive directory monitoring is not possible. That means you have to generate a file monitor for each directory and each sub-directory contained in it.\r\n\r\nAlso a manual re-scan is required sometimes. Let's assume the following situation of existing files and directories:\r\n- dir1\r\n  - file1.1\r\n  - file1.2\r\n- dir2\r\n  - file2.1\r\n  - file2.2\r\n\r\nNow someone copies in a new directory with 2 files in it, so the filesystem would look like this:\r\n- dir1\r\n  - file1.1\r\n  - file1.2\r\n- dir2\r\n  - file2.1\r\n  - file2.2\r\n- dir3\r\n  - file3.1\r\n  - file3.2\r\n\r\nThe file monitoring will only notify you about the new filepath for dir3. But you need to re-scan the directory on that event to also recognizes the files contained in it (and of course create a new file monitor for it to be notified of future changes in dir3)."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany-plugins/issues/332#issuecomment-366459919"}}}</script>