<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Your example only notifies on delete and not create (the last event set)...</div><div><br></div>Please try out this new runnable example in the wiki:<div><a href="http://gambaswiki.org/wiki/comp/gb.inotify/watch">http://gambaswiki.org/wiki/comp/gb.inotify/watch</a><br><br><div dir="ltr">Matt</div><div dir="ltr"><br>On 2 Mar 2019, at 19:33, T Lee Davidson <<a href="mailto:t.lee.davidson@gmail.com">t.lee.davidson@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><span>On 3/2/19 2:22 PM, Tobias Boege wrote:</span><br><span>[snip]</span><br><blockquote type="cite"><span>Indeed, the classes were renamed later, and possibly redesigned</span><br></blockquote><blockquote type="cite"><span>(I don't remember, but let's see):</span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>But when I want to run his code:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Dim hWatch As New Watch ("/tmp/gambas." & Str$(User.Id), True, 0) As</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>"GambasDirectory"</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>I get an error "too many arguments" ("trop d'arguments" my installation</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>being in French).</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Which syntax should be correct?</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><span>According to the documentation [1] this is the correct signature and</span><br></blockquote><blockquote type="cite"><span>the source code agrees. You should see (or be able to find in the</span><br></blockquote><blockquote type="cite"><span>"Debugging" tab of the panel on the bottom of the Gambas IDE window)</span><br></blockquote><blockquote type="cite"><span>a stack trace when an error happens. Is the error raised in your code</span><br></blockquote><blockquote type="cite"><span>or does the stack trace indicate that comes from *inside* gb.inotify?</span><br></blockquote><span>[snip]</span><br><span></span><br><span>Indeed, the classes were redesigned. The 'too many arguments' error is caused by the parameters in the event handler's (Create, Delete) signatures.</span><br><span></span><br><span>The example needs a little reworking:</span><br><span></span><br><span>' Gambas module file</span><br><span></span><br><span>Public Sub Main()</span><br><span>  ' Disable all unneeded events to increase performance</span><br><span>  Dim hWatch As New Watch("/tmp/gambas." & Str$(User.Id), True, 0) As "GambasDirectory"</span><br><span></span><br><span>  ' Capture creation and deletion of files or directories</span><br><span>  hWatch.Events[Watch.Create] = True</span><br><span>  hWatch.Events[Watch.Delete] = True</span><br><span>  Print "I'm watching... You may now start Gambas projects."</span><br><span>End</span><br><span></span><br><span>Public Sub GambasDirectory_Create()</span><br><span>  If Not Watch.IsDir Then Return</span><br><span>  Print "New directory for Gambas process";; Watch.Name;; " - ";;</span><br><span>  With Split(File.Load("/proc" &/ Watch.Name &/ "cmdline"), "/")</span><br><span>    Print "which is";; Left$(.[.Max], -1)</span><br><span>  End With</span><br><span>End</span><br><span></span><br><span>Public Sub GambasDirectory_Delete()</span><br><span>  If Not Watch.IsDir Then Return</span><br><span>  ' The directory in /proc/ may be removed at this time so we can't</span><br><span>  ' get any more information.</span><br><span>  Print "Gambas process";; Watch.Name;; "terminated (normally)"</span><br><span>End</span><br><span></span><br><span></span><br><span>___</span><br><span>Lee</span><br><span></span><br><span>----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net">https://www.hostsharing.net</a> ]----</span><br></div></blockquote></div></body></html>