add ability to set output directory for the file

add ability to set output directory for the file