View previous topic :: View next topic |
Author |
Message |
haferbrei Voice
Joined: 08 Apr 2020 Posts: 8
|
Posted: Wed Jan 13, 2021 2:39 am Post subject: inotify directory |
|
|
I am watching a directory for new files in Bash.
When a file is created, the file name will be output to the pipe (-> /tmp/directory/filename.ext) and exit.
$ inotifywait /tmp/directory/
How can I submit this to eggdrop so it will output the filename in a channel? Anybody have an idea? |
|
Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3690 Location: Mint Factory
|
Posted: Wed Jan 13, 2021 5:50 am Post subject: |
|
|
I guess the listen with script as argument would be your best bet.
Code: |
listen <port> script <proc> [flag]
Description: accepts connections which are immediately routed to a proc. The proc is called with one parameter: the idx of the new connection. Flag may currently only be 'pub', which makes the bot allow anyone to connect and not perform an ident lookup. Returns: port number
|
user (a forum member, sadly no longer active) created a socket api - nonblocking tcp made easy that is worth checking.
Haven't played with this feature and not sure what arguments and how you can pass them to the proc that's listening for your connection. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
Back to top |
|
 |
|