Deutsch English Français Italiano |
<v3tkub$1o860$4@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: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.c Subject: Re: Running an editor from ANSI C Date: Fri, 7 Jun 2024 00:40:44 -0000 (UTC) Organization: A noiseless patient Spider Lines: 14 Message-ID: <v3tkub$1o860$4@dont-email.me> References: <v3pge7$uf2i$1@dont-email.me> <v3r2pl$16mtl$1@dont-email.me> <v3r7v8$1b57j$1@dont-email.me> <v3rek5$1c4i5$1@dont-email.me> <v3rrtm$1e6g8$1@dont-email.me> <v3ru84$1eafb$1@dont-email.me> <Pcj8O.2409$R506.1932@fx36.iad> <v3sg75$1hmum$1@dont-email.me> <v3shg9$1htuf$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 07 Jun 2024 02:40:44 +0200 (CEST) Injection-Info: dont-email.me; posting-host="21a6995757d724b8d83dd14f044d030a"; logging-data="1843392"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5nvyLwCy6vBO9Z86fh+Jk" User-Agent: Pan/0.158 (Avdiivka; ) Cancel-Lock: sha1:VjQ+Mg7XdOWu6JZ7gH94kjVqawA= Bytes: 1855 On Thu, 6 Jun 2024 15:35:53 +0100, Malcolm McLean wrote: > The only way I can get the Baby X shell to run nano is to use tmpnam(). > I've tried mkstemp insteaad, and I just can't find a way. mkstemp opens the temporary file, which is not much use if you want to run an external program which requires a filename. To solve the potential race conditions with creating temporary files, I think the right solution is to use mkdtemp(3) instead. That creates and returns the name of a temporary directory. Now you are free to create as many files (and subdirectories) as you like with whatever names you like within that, secure in the knowledge that nobody else can interfere with you.