# Functions
WithReadLock runs the given function while holding a read lock on the directory `dir` It returns a bool indicating whether the lock was acquired, any error that occurred acquiring the lock, and the error value returned by the wrapped function.
WithWriteLock runs the given function while holding a write lock on the directory `dir` It returns a bool indicating whether the lock was acquired, any error that occurred acquiring the lock, and the error value returned by the wrapped function.