Deutsch English Français Italiano |
<v3r7v8$1b57j$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Malcolm McLean <malcolm.arthur.mclean@gmail.com> Newsgroups: comp.lang.c Subject: Re: Running an editor from ANSI C Date: Thu, 6 Jun 2024 03:47:04 +0100 Organization: A noiseless patient Spider Lines: 24 Message-ID: <v3r7v8$1b57j$1@dont-email.me> References: <v3pge7$uf2i$1@dont-email.me> <v3r2pl$16mtl$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 06 Jun 2024 04:47:04 +0200 (CEST) Injection-Info: dont-email.me; posting-host="fd1a4517109bed24a981b559f1527ee3"; logging-data="1414387"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18O2bO1f4ceYUhCv7nPVwlxHJl66NL3+LM=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:QfBhVc+KuT/WTmubHMVBlh0/4GI= Content-Language: en-GB In-Reply-To: <v3r2pl$16mtl$1@dont-email.me> Bytes: 1774 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. And you just can't edit files without non-ASCII keys. So at the moment I call system with nano, and it wotks. But it's a clunky solution. -- Check out Basic Algorithms and my other books: https://www.lulu.com/spotlight/bgy1mm