[Gambas-user] Pb instanciating inotify watch

Tobias Boege taboege at gmail.com
Sat Mar 2 20:22:19 CET 2019


On Sat, 02 Mar 2019, Alarc'h wrote:
> I thought I would use inotify to detect these events and I saw that
> there was already a class dedicated to this. I downloaded two examples
> that Tobias proposed several years ago to this url: 
> 
> http://gambas.8142.n7.nabble.com/gb-inotify-to-capture-filesystem-events-td45299.html
> 
> When I opened the projects I saw that he was instantiating Inotify
> objects, I think that was the name he had first thought of. The
> component documentation says to use Watch. I thought that by replacing
> Inotify with Watch in the code I would be able to use these examples,
> because one of them seems to do exactly what I need. 
> 

Indeed, the classes were renamed later, and possibly redesigned
(I don't remember, but let's see):

> But when I want to run his code: 
> 
> Dim hWatch As New Watch ("/tmp/gambas." & Str$(User.Id), True, 0) As
> "GambasDirectory"
> 
> I get an error "too many arguments" ("trop d'arguments" my installation
> being in French). 
> 
> Which syntax should be correct?
> 

According to the documentation [1] this is the correct signature and
the source code agrees. You should see (or be able to find in the
"Debugging" tab of the panel on the bottom of the Gambas IDE window)
a stack trace when an error happens. Is the error raised in your code
or does the stack trace indicate that comes from *inside* gb.inotify?

FTR, I just created a blank project and pasted the line above.
It runs as expected. Which begs the question: which version of
Gambas do you use and where did you get it from?

Regards,
Tobi

[1] http://gambaswiki.org/wiki/comp/gb.inotify/watch/_new

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list