Find the answer to your Linux question:
Results 1 to 2 of 2
hi all how can i lock, a file(name.txt) using c.(programatically) and unlock. help me thank you in advance...
  1. #1
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247

    lock and unlock

    hi all
    how can i lock, a file(name.txt) using c.(programatically)
    and unlock.

    help me
    thank you in advance
    "Relationships are built on trust and communication"

  2. #2
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Read fcntl man page - especially options F_SETLK/F_GETLK.
    Mind you, by default it is advisory locking - not enforced.
    For mandatory (forced) locking, you need support from the underlying filesystem. Read further down in the page I gave link for.
    The Unforgiven
    Registered Linux User #358564

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...