in reply to Shared flocks on Solaris?

Your code works fine for me on Solaris if I open the file for reading rather than writing (i.e. use "< $file") assuming the file already exists of course. The Solaris man page I have access to seems to indicate you must open the file for reading to use shared locks. You may want to explore opening the file for read and write if you need both kinds of locks. Update: In other words, try something like "+< $file" or use sysopen() and it's ilk instead.

bluto

Replies are listed 'Best First'.
Re: Re: Shared flocks on Solaris?
by BazB (Priest) on May 07, 2003 at 21:36 UTC

    It's always obvious when you know how to do it :-)

    bluto++ is right.

    After I reinvented the wheel using some C and the wonderful Inline::C, and more importantly spent more time grokking manpages, bluto came along and fixed my silly mistake :-).


    If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
    That way everyone learns.