No need to memset outdir because it is already initialized