On 8/3/2021 12:14 PM, Norman Gray wrote:
Greetings.
I can't find a way of doing something equivalent to exec in Racket.
Is this Hard, or am I just missing it?
By 'exec', I mean the equivalent of replacing the process with a new
image, as distinct from `system` (and friends) or `process` (and
friends), which are concerned with creating a subprocess, controlling
it, and handling its exit.
In my particular case, I want to call vi at the end of a Racket
script. I'm sure it's possible to do that with process and friends,
but it would require being careful about input and output ports,
worrying about buffering, whether things are terminals or not, and so
on and on.
I can imagine this isn't trivial as an implementation issue -- I can
see there would potentially be custodians to worry about (*waves hands
vaguely*), but I'd be surprised if it were impossible. However I'm
completely failing to find anything on [1], searching for eg 'exec' or
'return' (as in 'does not return'); and 'exec' isn't a very handy
search term on the web.
Thanks for any pointers,
Norman
[1] https://docs.racket-lang.org/reference/subprocess.html
Hi Norman,
Racket is multi-platform and tries to present a common API for dealing
with underlying operating systems. Windows is an important platform,
but Windows does not have the concept of fork/exec ... so Racket doesn't
offer it either. The closest (and simplest) you can achieve, I think,
would to start Vi asynchronously using 'process*' and then terminate the
Racket script.
Hope this helps,
George
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/2ab522f1-ea58-3a34-3ed5-24998a64da0f%40comcast.net.