Use dup2 instead of assign for redirection - may work better on Windows