dir should be file