Comment 11 for bug 1786927

Revision history for this message
Dirk Zimoch (dirk.zimoch) wrote :

Quick test of redirection with this function:

/* foo */
void foo() {
  std::printf("std::printf\n");
  ::printf("::printf\n");
  printf("printf\n");
}
static const iocshFuncDef fooFuncDef =
    {"foo",0,0};
static void fooCallFunc(const iocshArgBuf *)
{
    foo();
}

Linux iocsh:
epics> foo
std::printf
::printf
printf
epics> foo > foo.txt
epics> system "cat foo.txt"
std::printf
::printf
printf
epics>

vxWorks 5.5:
> foo
std::printf
::printf
printf
value = 7 = 0x7
> foo > /home/ioc/foo1.txt
value = 7 = 0x7
> copy < /home/ioc/foo1.txt
std::printf
::printf
printf
value = 0 = 0x0
> iocshCmd "foo"
std::printf
::printf
printf
value = 0 = 0x0
> iocshCmd "foo > /home/ioc/foo2.txt"
value = 0 = 0x0
> copy < /home/ioc/foo2.txt
std::printf
::printf
printf
value = 0 = 0x0
>

All good. But I have not tested on Windows or RTEMS.