Permission denied error creating firebird embedded database in OSX

firebird, macos

Solution

Solved! After re-reading this document several times I finally got it: Embedded Firebird on MacOSX.

The embedded library under OSX is the same as what would be called the exe in Windows. In the /Library/Framworks/Firebird.framework folder is an executable just called "Firebird". The key text I did not understand is this "renamed the Firebird file to libfbembed.dylib". My Windows experience was tripping me up because in Windows you would never rename an .exe to a .dll. I don't know if its possible in Windows, but I've never heard of it.

There was a couple more trivial things I needed to do so here is the full instructions.

Link the "Firebird" {executable} to /usr/local/lib/libgds.dylib

ln -s /Library/Frameworks/Firebird.framework/Firebird /usr/local/lib/libgds.dylib

Link the firebird.msg file so that it appears in the /usr/local/lib folder

ln -s /Library/Frameworks/Firebird.framework/Versions/A/Resources/English.lproj/var/firebird.msg /usr/local/lib/firebird.msg

Copy the "security2.fdb" to the /usr/local/lib folder and change its permissions to give write access. It does not work to make a link to this file.

cp /Library/Frameworks/Firebird.framework/Versions/A/Resources/English.lproj/var/security2.fdb /usr/local/lib
chmod 777 /usr/local/lib/security2.fdb

Problem

Firstly I am not 100% sure I am using the embedded firebird client under OSX. The install file that I downloaded from firebirdsql.org states that it contains Classic, Superclassic & Embedded. Unlike the windows version there does not appear to be a dedicated embedded library file in the package. I have assumed that the `libfbclient.dylib` (renamed `libgds.dylib` for my use) can be used as embedded. If I am wrong then I guess thats the problem. Can someone tell me where I get the embedded dylib file? If libfbclient.dylib is for embedded use also then my question remains. When I try to create the database file for the first time it fails with "Permission denied". I am trying to create this file in the users documents folder. I am using the Interbase Express components in Delphi to connect. This has served me well for years under the windows environment. The full error message is... `Exception class EIBInterBaseError with message 'I/O error during "open O_CREAT" operation for file '/Users/martin/Documents/LightFactoryShows/default.fdb" Error while trying to create file Permission denied'`

Original source