This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

inotify directory

Help for those learning Tcl or writing their own scripts.
Post Reply
h
haferbrei
Voice
Posts: 23
Joined: Wed Apr 08, 2020 8:57 pm

inotify directory

Post by haferbrei »

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?
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I guess the listen with script as argument would be your best bet.

Code: Select all

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.
h
haferbrei
Voice
Posts: 23
Joined: Wed Apr 08, 2020 8:57 pm

Post by haferbrei »

u need only the tcl-ionotify modul.
thats it
Post Reply