in reply to -w $path Cross Platform Issues
You're better off just trying to write, because -w checks for permissions, not for locks