Added interface to allow output to directories other than the current directory.