http://qs321.pair.com?node_id=301356


in reply to Re: Re: C vs. Perl
in thread C vs. Perl

You can't do anything more easily in C as opposed to Perl. That has never been a question.
Oh, sure you can. Ever tried locking *part* of a file? Quite a standard operation, but I don't think it's even documented how you do it in Perl.

Abigail

Replies are listed 'Best First'.
Re: Re: C vs. Perl
by dug (Chaplain) on Oct 22, 2003 at 22:32 UTC
    I haven't found it in the core documentation, but there is a recipe in "Perl Cookbook" (recipe 7.25 in the second edition) called "lockarea" that dooes just this. It's not very portable (and isn't easier than its C counterpart), but works on Berkley-ish systems.

    The Cookbook says, "This program, while included with Perl...". I didn't find it in the latest sources when looking for "lockarea". Does anyone else know where it is in the source, or when it was depricated if it's not there?

    -- dug