On Sun, Jan 25, 2015 at 12:57:22AM +0200, Mircea S. wrote:
> Hmm. Both "(NBSQLite3Connection on: 'test.db') open". or "NBSQLite3Connection
> openOn: 'test.db' " produce an "unable to open database file" error and no
> file gets created. Even tried to move the image to a FAT32 usb stick to make
> sure it wasn't a permission issue. 

I get the same error on my OSX Mavericks, whereas on my Linux Mint 17
installation test.db is created in my image's directory.

On OSX, "OSProcessAccessor forThisOSProcess primGetCurrentWorkingDirectory"
gives "/", while on Linux the same gives "/home/pierce/work/pharo30". (Above
requires the OSProcess package which is available from the Config Browser.)

Hence I think this is a permission issue based on the default current
directory of the VM operating system process being / on OSX. This suggests to
use openOn: with a FQPN on OSX.

Curiously, when I run Pharo.app as root via

  $ sudo ~/pkg/Pharo.app/Contents/MacOS/Pharo pharo30.image

NBSQLite3Connection openOn: 'test.db' works, test.db -- owned by root -- is
created in the directory where pharo30.image lives, and "OSProcessAccessor
forThisOSProcess primGetCurrentWorkingDirectory" gives
"/Users/pierce/working/pharo30"! 

Alright, it is not that curious. Taking away the sudo above, meaning invoking
the VM on the command line as my regular UID, still gives the "correct" working
directory. So this looks like some strange difference between the Cocoa (or
Carbon?) OSX application Pharo.app and the Mach-O executable Pharo.



Reply via email to