procmail
[Top] [All Lists]

locking two files in one recipe

1997-04-24 21:07:00
I have a recipe that writes to two different files in different
directories, and I need to lock them both. For now, I am only locking
the more important of the two, but would like to lock them both to
avoid corruption. Here is my recipe: FILE and LOG are the two files I
want to lock.

        :0 chiw: "$FILE.lock"
        | echo ; echo "$FROM" >> "$FILE" ; \
        sort -bdfu "$FILE" -o "$FILE" ; \
        echo "$DATA" >> "$LOG"

Can more than one lockfile be designated? Am I using the lockfile
correctly? From the log it looks like it is successfully locking and
unlocking the designated file.

David <dnhunt(_at_)rain(_dot_)org>

<Prev in Thread] Current Thread [Next in Thread>