Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: locking a file in zsh?
- X-seq: zsh-users 14883
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: locking a file in zsh?
- Date: Tue, 23 Feb 2010 22:33:58 +0000
- In-reply-to: Message from Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> of "Tue, 23 Feb 2010 22:05:50 GMT." <20100223220550.1d934b0c@pws-pc>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Peter Stephenson wrote:
> # in .zshrc
> zmodload -aF zsh/system b:zsystem
>
> # in window A
> touch /tmp/zsystem_filelock
> (
> zsystem /tmp/zsystem_filelock
> print locked
> sleep 10
> )
>
> # in window B
> zsystem /tmp/zsystem_filelock
er... sorry
# in .zshrc
zmodload -aF zsh/system b:zsystem
# in window A
touch /tmp/zsystem_filelock
(
zsystem flock /tmp/zsystem_filelock
print locked
sleep 10
)
# in window B
zsystem flock /tmp/zsystem_filelock
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author