Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File Trigger
#1
Using file trigger to monitor for *.txt files that have been added or modified which are written to a directory via ftp.

When a file gets added, the function runs for event 1 and event 8 even though I put the whole thing in a sel case statement where case [1,8] should catch added and modified, but it still runs for each event type.

Code:
Copy      Help
function event $name [$newname]
out
;event: 1 added, 2 removed, 4 renamed, 8 modified
out event
sel event
,case [1,8]
,str s.getfile(name)
,s.replacerx(".*?''" "" 4)
,str pattern="''(.*?)'':''(.*?)''"
,ARRAY(str) a
,findrx(s pattern 0 4 a)
,int i
,for(i 0 a.len)
,,out F"{a[1 i]}    {a[2 i]}"


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)