Some checks for the library directory

Check if it's a real directory, and if it's writable.