consisten api for resetDir