Added stdin/stdout file handling