Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: locking a file in zsh?



On Feb 23, 10:05pm, Peter Stephenson wrote:
}
} Here's a *very* minimal implementation that basically copies Wayne's
} code from hist.c to a new builtin, "zsystem", in the zsh/system module, as
} the subcommand "flock".
} 
} zmodload -aF zsh/system b:zsystem
} 
} # in window A
} touch /tmp/zsystem_filelock
} (
}    zsystem /tmp/zsystem_filelock

zsystem flock /tmp/zsystem_filelock	# I believe you meant?

}    print locked
}    sleep 10
} )
} 
} # in window B
} zsystem /tmp/zsystem_filelock

Same insertion of "flock" needed ...



Messages sorted by: Reverse Date, Date, Thread, Author