From: Felipe Kellermann <stdfk@terra.com.br>
To: zsh-users@sunsite.dk
Subject: Opinion: locks, nonblock
Date: Thu, 24 Mar 2005 21:18:01 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.61.0503242037320.6584@nyvra.alien.bet> (raw)
Greetings,
This is more a request for opinions than a question.
Last weekend I decided that I'd try to implement a native "shell file
locking". I have made a patch to bash 3.0.14 just for experimenting:
http://fk.geek42.org/bash-3.0.14-lock.patch
The patch adds to options: exlock and nonblock.
That was just a test. exlock implements a lock to every file opened by the
shell (using exec) and nonblock makes O_NONBLOCK'ed operations (including
the possibly exlock'ed I/O).
My real target while making the patch was the possibility to write a zsh
module to implement such operations in a native way. Most of these could
very well be implemented outside the shell while others would have to be
implemented natively in the environment.
For instance, I have been using lockfile (of procmail) to lock files for
years. Now I'm wondering if it would not be nicer to have that operation
natively in my zsh environment.
Some of these operations - like setting a nonblock flag to a fd, or just
temporarily locking a fd - could help in various ways.
So, the opinions...
Does anyone implemented something like that already? Or else, does anyone
have specific tricks to achieve similar functionality? I've researched a
bit and found nothing.
Do you guys think it would be nice to have that functionality implemented
natively in the shell?
Also, any pointers to implementing that functionality? Would it be better
designed as a module or natively to the zsh? At first I thought it would
be nice to write a module implementing something like a "generic file
descriptior handling" operation.
Are are your opinions on these points?
Thanks,
--
Felipe Kellermann
next reply other threads:[~2005-03-25 3:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-25 0:18 Felipe Kellermann [this message]
2005-03-26 18:11 ` Bart Schaefer
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=Pine.LNX.4.61.0503242037320.6584@nyvra.alien.bet \
--to=stdfk@terra.com.br \
--cc=zsh-users@sunsite.dk \
/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).