rewrite `rename' and `rmdir' to properly invalidate the cache