Sujet : Re: Running an editor from ANSI C
De : mikko.levanto (at) *nospam* iki.fi (Mikko)
Groupes : comp.lang.cDate : 06. Jun 2024, 16:42:22
Autres entêtes
Organisation : -
Message-ID : <v3slcu$1ijch$1@dont-email.me>
References : 1 2 3
User-Agent : Unison/2.2
On 2024-06-06 02:47:04 +0000, Malcolm McLean said:
On 06/06/2024 02:18, Lawrence D'Oliveiro wrote:
On Wed, 5 Jun 2024 11:59:19 +0100, Malcolm McLean wrote:
So I just call system with nano.
The trouble with system(3) is it requires a shell as an intermediary, with
consequent pitfalls involving command-line parsing.
More robust to use posix_spawn(3).
>
The concept is an ANSI C only shell.
I can write my own text editor on top of Posix easily enough.
But I want to implent an "edit" command so that users can edit files.
Just make the editor a part of the shell.
And you just can't edit files without non-ASCII keys.
I have edited files without non-ASCII keys so I know it can be done.
However, non-ASCII keys make it easier, especially if the files contain
non-ASCII characters.
So at the moment I call system with nano, and it wotks. But it's a clunky solution.
-- Mikko