The function uses stdio instead of Rprintf / REprintf or warning , so redirecting the output R will not work. The correct solution is to fix the calls in libsvm to use the output R.
Stdio output may fail - you can redirect the output to your own channel and do what you want with it, but a) it works a little in C and b) it is dangerous because you need to restore the standard behavior after you finish with the function - even if it is an error and c) internally it can interact with the output R, if used in the shell.
If you want a really good, dirty, but quick solution, run your function in collect(parallel(..., silent=TRUE))[[1]] from multicore - it suppresses stdout (you can add multicore:::closeStderr() if you want to suppress stderr as well).
source share