[Gambas-user] Pb instanciating inotify watch

Alarc'h alarch at alarch.pw
Sat Mar 2 20:01:41 CET 2019


Hello,

This message is more particularly intended for Tobias because it
concerns the gb.inotify component.

I want to make a small application that can detect the mounting or
unmounting of usb sticks in the /media/username directory in order to
be able to propose formatting or creating a bootable iso image on the
key. 

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. 

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?

-- 
        __
     __/o \_
     \____  \
         /   \
        //\   \
__/o \-//--\   \_/
\____  ___  \  |
     ||   \ |\ |
    _||   _||_||


More information about the User mailing list