a simple file and directory wrapper with a writability guard