Score:0

find snap app temporary folder programatically

ng flag

I run python scripts that call system applications to produce some output files. The user can decide to put those file in a temporary folder, for example using tempfile.gettempdir(). However this fails if the app is a snap.

So how can I find the app is a snap from python? and then, how can I find its tempdir?

muru avatar
us flag
The linked post says that snaps have a per-snap tmp, so that should be sufficient for your use case. What's the actual error you're getting?
JuanPi avatar
ng flag
@muru the error is that the snap app cannot write to the tempdir (e.g. `/tmp`). My idea is to 1. detect if the app is a snap, 2. if it is set tempdir to the app temporary folder (or an user folder with my app name, e.g. like Firefox in ~/Downloads)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.