egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

inotify directory

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
haferbrei
Voice


Joined: 08 Apr 2020
Posts: 21

PostPosted: Wed Jan 13, 2021 2:39 am    Post subject: inotify directory Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3733
Location: Mint Factory

PostPosted: Wed Jan 13, 2021 5:50 am    Post subject: Reply with quote

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
View user's profile Send private message
haferbrei
Voice


Joined: 08 Apr 2020
Posts: 21

PostPosted: Sat Mar 20, 2021 4:46 am    Post subject: Reply with quote

u need only the tcl-ionotify modul.
thats it
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber