put file in dir if second arg is dir