digitalmars.D - Is std.process.browse a category mistake?
- kdevel (4/4) May 27 2022 https://dlang.org/phobos/std_process.html#browse
- Adam Ruppe (2/3) May 27 2022 Why? It does spawn a process, after all...
- kdevel (2/5) May 27 2022 The same applies to std.process.water_the_flowers.
- Adam D Ruppe (4/5) May 27 2022 and it should really be there. On Windows, there's a function to
- H. S. Teoh (11/17) May 27 2022 On (some flavors/configurations of) Linux there's `xdg-open` that does
- H. S. Teoh (5/11) May 27 2022 Where would be a better place for it?
- kdevel (2/12) May 27 2022 In std.useragents?
- H. S. Teoh (7/20) May 27 2022 A completely separate module seems unwarranted. Maybe a submodule of
- Jack (3/8) May 27 2022 I think it belong to the process module. I wonder why it's there
- rikki cattermole (3/3) May 27 2022 Its not that unusual, and it can be quite useful.
- kdevel (5/9) May 27 2022 So is std.process.water_the_flowers.
- user1234 (9/14) May 28 2022 This is a legacy function comming from the first the std.process
https://dlang.org/phobos/std_process.html#browse void browse(scope const(char)[] url); Start up the browser and set it to viewing the page at url. It feels wrong that this function is in std.process.
May 27 2022
On Friday, 27 May 2022 at 18:46:36 UTC, kdevel wrote:It feels wrong that this function is in std.process.Why? It does spawn a process, after all...
May 27 2022
On Friday, 27 May 2022 at 19:05:15 UTC, Adam Ruppe wrote:On Friday, 27 May 2022 at 18:46:36 UTC, kdevel wrote:The same applies to std.process.water_the_flowers.It feels wrong that this function is in std.process.Why? It does spawn a process, after all...
May 27 2022
On Friday, 27 May 2022 at 19:14:33 UTC, kdevel wrote:The same applies to std.process.water_the_flowers.and it should really be there. On Windows, there's a function to just open any file in the user's preferred application. (That's actually the one `browse` calls.) It is kinda useful to have.
May 27 2022
On Fri, May 27, 2022 at 07:36:38PM +0000, Adam D Ruppe via Digitalmars-d wrote:On Friday, 27 May 2022 at 19:14:33 UTC, kdevel wrote:On (some flavors/configurations of) Linux there's `xdg-open` that does pretty much the same thing. If installed, that is. Minimal setups may not include this utility. Nonetheless, it may be a convenient thing to have, who knows. ... and in fact, xdg-open is what std.process.browse calls, if it exists. If $BROWSER is set, that gets used in preference over xdg-open. But if $BROWSER isn't set, xdg-open is used as a fallback. T -- MAS = Mana Ada Sistem?The same applies to std.process.water_the_flowers.and it should really be there. On Windows, there's a function to just open any file in the user's preferred application. (That's actually the one `browse` calls.) It is kinda useful to have.
May 27 2022
On Fri, May 27, 2022 at 06:46:36PM +0000, kdevel via Digitalmars-d wrote:https://dlang.org/phobos/std_process.html#browse void browse(scope const(char)[] url); Start up the browser and set it to viewing the page at url. It feels wrong that this function is in std.process.Where would be a better place for it? T -- Bomb technician: If I'm running, try to keep up.
May 27 2022
On Friday, 27 May 2022 at 19:10:59 UTC, H. S. Teoh wrote:On Fri, May 27, 2022 at 06:46:36PM +0000, kdevel via Digitalmars-d wrote:In std.useragents?https://dlang.org/phobos/std_process.html#browse void browse(scope const(char)[] url); Start up the browser and set it to viewing the page at url. It feels wrong that this function is in std.process.Where would be a better place for it?
May 27 2022
On Fri, May 27, 2022 at 07:16:32PM +0000, kdevel via Digitalmars-d wrote:On Friday, 27 May 2022 at 19:10:59 UTC, H. S. Teoh wrote:A completely separate module seems unwarranted. Maybe a submodule of std.process? Like std.process.programs? std.process.clients? Something like that. T -- Marketing: the art of convincing people to pay for what they didn't need before which you fail to deliver after.On Fri, May 27, 2022 at 06:46:36PM +0000, kdevel via Digitalmars-d wrote:In std.useragents?https://dlang.org/phobos/std_process.html#browse void browse(scope const(char)[] url); Start up the browser and set it to viewing the page at url. It feels wrong that this function is in std.process.Where would be a better place for it?
May 27 2022
On Friday, 27 May 2022 at 18:46:36 UTC, kdevel wrote:https://dlang.org/phobos/std_process.html#browse void browse(scope const(char)[] url); Start up the browser and set it to viewing the page at url. It feels wrong that this function is in std.process.I think it belong to the process module. I wonder why it's there tho. So unusual to have such function in the std process.
May 27 2022
Its not that unusual, and it can be quite useful. https://docs.oracle.com/javase/9/docs/api/java/awt/Desktop.html#browse-java.net.URI- https://developer.apple.com/documentation/uikit/uiapplication/1648685-open
May 27 2022
On Friday, 27 May 2022 at 19:34:32 UTC, rikki cattermole wrote:Its not that unusual,In ISO-C++ there is no such function.and it can be quite useful.So is std.process.water_the_flowers.https://docs.oracle.com/javase/9/docs/api/java/awt/Desktop.html#browse-java.net.URI-That is AWT. std.process is not a windowing toolkit.https://developer.apple.com/documentation/uikit/uiapplication/1648685-openstd.process is not about user interfaces.
May 27 2022
On Friday, 27 May 2022 at 18:46:36 UTC, kdevel wrote:https://dlang.org/phobos/std_process.html#browse void browse(scope const(char)[] url); Start up the browser and set it to viewing the page at url. It feels wrong that this function is in std.process.This is a legacy function comming from the first the std.process version. That function existed and was kept after the [redesign]. It's usefulness was a bit discussed [at that time]. Valid point to my eyes is that it does not return a PID, you cant pipe it, you can wait it. [redesign]: https://github.com/dlang/phobos/pull/1151 [at that time]: https://forum.dlang.org/search?q=browse&scope=threadmd5%3Af6005efc9c5f341f2fe880f9c7af8949
May 28 2022