Closed marcusgregory closed 3 years ago
set linuxByProcess
to true
. then it uses xdg-open
I sent a pull request fixing this issue, I think linuxByProcess is no longer needed, unless the developer explicitly wants to use it.
@mx1up I'm not familiar with Linux development, so is his solution appropriate
Thanks for accepting the pull request, I assume I can close this issue now.
@crazecoder I believe the issue is fixed by the addition of Uri.file
, no need for string interpolation in system call or xdg-open arg
I'll add a review to the PR
since linux.system call simply forks a new process with sh -c command
, I'm not sure the shell supports the file uri's but I assume @marcusgregory has tested this
Also, this fix would make it no longer possible to open a remote file, i.e. https://abc.xyz/investor/static/pdf/2021Q1_alphabet_earnings_release.pdf but that's probably out of scope of this package :)
@crazecoder sorry for the confusion, the linux.system call also simply calls xdg-open, so effectively, it is the same. I would vote to remove one code path. Both spawn a process, using the linux.system call, you spawn an extra process (the shell process) and it does not add any benefit. So I would simply call Process.run as it is the most transparent and efficient.
actually, according to the documentation, system call seems to spawn 2 extra processes: https://man7.org/linux/man-pages/man3/system.3.html
First I make an HTTP request and save the file to disk, here below is the response header with the filename:
No exceptions occur at runtime, only show this message in the logs and the file doesn't open