check command line arguments whether to redirect stdout or stderr
C language IO functions completely replaced