From: Clinton Bunch <cdb_zsh@zentaur.org>
To: Peter Stephenson <p.stephenson@samsung.com>, zsh-workers@zsh.org
Subject: Re: [RFC] adding zmktemp command
Date: Thu, 28 Mar 2019 10:25:42 -0500 [thread overview]
Message-ID: <0858fff0-92aa-8434-18f9-64387f2a4f3c@zentaur.org> (raw)
In-Reply-To: <1553786227.5713.19.camel@samsung.com>
On 3/28/2019 10:17 AM, Peter Stephenson wrote:
> On Wed, 2019-03-27 at 16:16 -0500, Clinton Bunch wrote:
>> But it also seems like it would be a good fit into the zsh/files module
>> (mktemp and zf_mktemp instead of zmktemp)
>>
>> Thoughts?
> It occurs to me that one reason for doing this might be that you could
> add a zf_mkstemp function (no reason for compatibility with any external
> command) that both creates and opens a file using mkstemp(), returning
> the file descriptor in REPLY as usual. This is then secure.
> That's something that's hard to do without a builtin.
>
> pws
I was actually planning on adding a -f option to return a fd as the
zsystem flock command does. This could then be used in print -u,
sysseek, and read -u statements. I would also probably use mkstemps
(hand-rolled where not available in libc) as suffixes can be a good
thing. This would also relieve the predictability issue with HP-UX's
mkstemp.
I didn't think about using REPLY by default. That could cause issues
with use of read -u if they rewind the file
next prev parent reply other threads:[~2019-03-28 15:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20190327211847epcas2p395ce077891a4535f19e1e9605217df7c@epcas2p3.samsung.com>
2019-03-27 21:16 ` Clinton Bunch
2019-03-28 9:38 ` Daniel Shahaf
2019-03-28 15:00 ` Clinton Bunch
2019-03-28 21:13 ` Daniel Shahaf
2019-03-29 15:20 ` Clinton Bunch
2019-03-28 15:17 ` Peter Stephenson
2019-03-28 15:25 ` Clinton Bunch [this message]
2019-03-28 15:36 ` Oliver Kiddle
2019-03-28 15:40 ` Clinton Bunch
2019-03-28 20:26 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0858fff0-92aa-8434-18f9-64387f2a4f3c@zentaur.org \
--to=cdb_zsh@zentaur.org \
--cc=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).