💾 Archived View for bbs.geminispace.org › u › sloum › 11946 captured on 2024-07-09 at 03:21:12. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-06-16)

➡️ Next capture (2024-08-19)

🚧 View Differences

-=-=-=-=-=-=-

Comment by 🌲 sloum

Re: "How to open files and URLs with the preferred application..."

In: s/Gemini

@clseibold Yes, most languages will have some module for OS detection. You can check against `$OSTYPE`, which I believe should be available for pretty much every major system. Subprocessing out to `uname` can also be useful for this purpose. I can't remember which I did... my use case was in a makefile (for gnu make, since bsd make does not support if statements). So I think it makes sense in a makefile (again, targeting a non-bsd system) but may not have the same use case in a more full featured language/environment.

🌲 sloum

2023-11-22 · 8 months ago

Original Post

🌒 s/Gemini

How to open files and URLs with the preferred application in multiple operating systems? Not really related to Gemini, but I need to implement a way in my Gemini client to open unsupported URLs and files on their proper apps, mostly on Linux but ideally in other systems as well. Fellows who have written their own clients, how did you do it?

💬 lufte · 15 comments · 2023-11-21 · 8 months ago