Gambas Documentation - /dev/api/name/gb.watch

/dev/api/name/gb.watch

# GB.Watch

void GB.Watch ( int fd , int flag , GB_WATCH_CALLBACK callback , long param )

Asks the interpreter to watch or to stop watching a specific file descriptor.

- fd is the file descriptor to watch.

- flag is one of the following constants that defines the watch action:

  - GB_WATCH_NONE, to stop watching.

  - GB_WATCH_READ, to watch for reading.

  - GB_WATCH_WRITE, to watch for writing.

  - GB_WATCH_READ_WRITE, to watch for both reading and writing.

- callback is the address of a function that will be called each time the fd file descriptor fulfils the condition defined by flag.

- param is a long constant passed to the callback.

### See also

- /wiki/api/cat/watch