Odd behavior of system(); Linux Mint (Flatpak)

Hi! I’m using 6.3.0 on linux mint. Trying to “system(”/usr/bin/xreader …"). Get error “/usr/bin/xreader: No such file or directory”. Same result when using unix().

When I system(“ls -l /usr/bin/xreader”) xreader can’t be found.

If I system(“ls -l /usr/bin”), it shows a different listing than when I issue it in a shell!!?!? About 1/3 as many files.

When there is an intersection in file names, they have different dates, sizes, etc.

What’s happening?
Thanks. Doug

Do you use Octave via Flatpak or Snap? These days many Linux distributions make use of those container solutions, even when installing via the default package installation tool. I do not know the situation with Linux Mint (Debian/Ubuntu based). You can find out with either of

flatpak list
snap list

If you use Octave via Flatpak or Snap, you basically run a container (a very lightweight virtual machine) and only your home directory and another technical important directories are mounted into that container. Thus any software installed on your host Linux Mint system is most likely invisible to the Octave container (Flatpak, Snap).

Hi @siko1056!
Ahh!
Flatpak (Mints latest is 5.2.0!?!?)
Didn’t know about the VM, but makes sense.
So it has its own copy of /usr/bin, then? Also makes sense.

Thanks
Doug

That is a quite old version of Octave. Using Flatpak, you can upgrade to Octave 6.3.0 Flathub—An app store and build service for Linux. However, I do not know the internal workings of Linux Mint.

Unfortunately yes. This container runs its own libraries and binaries. Getting software from the host system running in the container is difficult due to probable library incompatibilities.

Applications like xreader have to be started outside the Flatpak Octave container.

Probably an overkill for your use case is building Octave from source. If you choose this approach stick to the “Debian / Ubuntu” guides for Linux Mint.

You can also use system ('flatpak-spawn --host /usr/bin/xreader …') to run the command outside of the Octave flatpak sandbox.

1 Like

@siko1056 & @mtmiller, Thanks for the replies.

It’s easy enough to just open xreader outside of the Octave GUI, I was just curious why I couldn’t from inside the GUI. Now I know.

Doug