in reply to File problems

Either backticks or open() with a pipe symbol would serve your purposes. Doing both of them, however, is a Bad Idea. It ends up trying to execute the first file in the wildcard pattern ... which presumably fails, so you get no output.

Fortunately for you, you can replace this whole function with a single system() call:

system("ls /dir/error* >/tmp/err_list 2>/dev/null");

The "2>/dev/null" makes sure that any error messages from the 'ls' program won't be visible to the person running your code.

    -- Chip Salzenberg, Free-Floating Agent of Chaos