[GNC] Symbolic links (MacOSX)

john jralls at ceridwen.us
Sun Jul 24 11:54:47 EDT 2022


> On Jul 23, 2022, at 10:38 AM, Peter S. Shenkin <shenkin at gmail.com> wrote:
> 
> Hi,
> 
> I'm getting back to gnucash after a long hiatus. I'm also starting up using
> Gnucash on a different computer. So I copied the Gnucash directory to
> ~/Documents/work/Foo/ on the new computer. (The name Foo was changed to
> protect the innocent. Or is it the guilty?)
> 
> Gnucash had been in ~/work/Foo on the old computer, so set up a symbolic
> link in ~/work called Foo pointing to ~/Documents/work/Foo. To my surprise,
> I got a msg that Gnucash couldn't parse the URL, and another, after
> dismissing that dialog, that Gnucash could not open the file.
> 
> Eventually, as kind of a Hail-Mary pass, I replaced the symlink with an
> actual copy (cp -pR) of the Foo directory from ~/Documents/work to ~/work,
> and then Gnucash could read it.
> 
> This struck me as extremely bizarre. I have two questions.
> 
>   - Can Gnucash really not read through symlinks on MacOS?
>      - Note that my Privacy settings allow Gnucash to read the ~/Documents
>      directory, to which the symlink points.
>      - In retrospect, I guess I should have tried using a MacOS "alias"
>      instead of a symlink, but I don't know if that would have worked
> any better.
>      - There is nothing in Privacy to specify that Gnucash can read ~ or
>      ~/work, but apparently this is not needed.
>   - Suppose I now want to tell Gnucash to use the data in
>   ~/Documents/Foo/Gnucash. Is there a way for me to do this without losing my
>   history? (Or my sanity?)

I just tested a regular symlink and an alias. GnuCash had no trouble opening a file through the symlink using File/Open or subsequently reopening the file on launch. Perhaps you misspelled something when you made the symlink.

Navigating through macOS alias files requires opening files through CFURL.  boost::filesystem doesn't know how to do that so neither does GnuCash. FWIW bash and zsh don't either.

GnuCash has access to Documents, Downloads, Desktop, and Network drives in System Settings>Privacy & Security>Files and Folders (I'm running macOS 13 developer beta on this mac). It does not have full disk access.

I suppose that the history you have in mind is the list of most recently used files at the bottom of the File menu. The simplest way to migrate to the new directory is to use File>Open  to open each in turn ***bottom to top***.

Regards,
John Rals



More information about the gnucash-user mailing list