function like printf,in Bro language

Hi
:slight_smile:
I make one change in demux.bro :
...
function demux_conn(id: conn_id, tag: string, otag: string, rtag: string): bool
{
  ...
  if ( ! created_demux_dir )
  {
  mkdir(demux_dir);
  created_demux_dir = T;
         printf("%s",demux_dir);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~change here.
  }
  ...
}
...

And invoke bro ,using : ./bro -i eth0 demux.bro

And the output is :
    policy/demux.bro,line 21 (printf):error,undeclared variable
    policy/demux.bro,line 21 (printf(%s,demux_dir)):warning,expression value ignored

Is there a function doing what does "printf" do ,in Bro language?

Thanks for your help,and have a nice day. :slight_smile:

cloud

        printf("%s",demux_dir);

[...]

Is there a function doing what does "printf" do ,in Bro language?

There is "fmt" which builds a string in a printf-like way (see the
"predefined functions" section in Bro's manual for details).

But for the case above, you don't need it actually:

    print demux_dir;

Robin