Write on host filesystem

Hello,

I created an AppImage from electron-builder, and it won’t write to the filesystem. I’m trying to create the /tmp/myapp folder, but nothing is created, where it works unpacked with the very same code.

As you can guess, I’m using JS, and this is the code that creates the folder:

const fs = window.require('fs');
const TEMP_DIR = '/tmp/b2saves/'; // I tried with a folder in $HOME without success

export function loadSaves(savePath, tempDir = TEMP_DIR) {
    if (!fs.existsSync(tempDir))
        fs.mkdirSync(tempDir, {recursive: true});

so nothing fancy here.

I guess I’m misunderstanding the goal of AppImage, and the “sandbox” surrounding it. Am I simply allowed to write to the host filesystem? Do I need to specify something in the building process to access the host’s filesystem?

Thank you

There is no sandbox. You should be able to write to /tmp.

1 Like

Thank you, I’ve learned there’s no sandbox, great! I found out my issue is with something else, I’ll open another thread.

1 Like