Improve flexibility when encountering readonly directories