Thread: Pico vs Vi(m) read lock question

  1. #1
    Banned
    Join Date
    May 2007
    Location
    Berkeley, CA
    Posts
    329

    Pico vs Vi(m) read lock question

    The following places a read lock over cf.buffer

    Code:
    % lockf "/home/nh/cf.buffer" sleep 10000 &
    Now here' s what I'm mystified by. I run this and then i fire up the Vi(m) editor. The editor warns me that the file is read only and then refuses to let me modify the file. But when I dot he same thing with Pico, I get no warning and the Pico editor will not only let me write to cf.buffer but also save the changes.

    Why is this?
    Last edited by Overworked_PhD; 06-28-2009 at 05:00 PM.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    lockf places an advisory (or voluntary) lock, not a mandatory one. This means that applications that aren't aware of this form of locking (as pico apparently is) simply ignore it.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about arrays?? PLease read..
    By foofoo in forum C Programming
    Replies: 3
    Last Post: 06-24-2002, 02:40 PM
  2. quick question, please read
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 03-10-2002, 03:29 PM
  3. what does this warningmean???
    By kreyes in forum C Programming
    Replies: 5
    Last Post: 03-04-2002, 07:53 AM
  4. Yet another read file question ...
    By Unregistered in forum Windows Programming
    Replies: 2
    Last Post: 02-28-2002, 11:00 PM
  5. DirectX question, please read!
    By Crossbow in forum Game Programming
    Replies: 2
    Last Post: 12-12-2001, 07:18 PM