Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default File Lock

    How can we know when a file is locked using flock system call in linux.

    Thanks
    Amrith Guest

  2. Similar Questions and Discussions

    1. lock file
      Using Contribute version 3. Drafts erased prior to publishing and now unable to edit. Receive error message stating that someone else is editing...
    2. Cannot Lock aspx File
      When I click on the Edit Page button, I receive the following error: Cannot lock the page to prevent other users from editing it. Please try...
    3. #40008 [NEW]: lock file
      From: wisans at gmail dot com Operating system: window xp PHP version: 5.2.0 PHP Bug Type: Performance problem Bug...
    4. Anyone else have a file lock problem?
      We have a problem with File Locks on systems with Illustrator 10 or CS installed on them. It is intermittent so it has been a problem to isolate....
    5. Best way to lock and open a file
      I have a single line file where the line will be read and updated each time it is opened. My question is I need to open it with a lock so noone...
  3. #2

    Default Re: File Lock

    In article <f253dece.0307072302.3bf31538@posting.google.com >,
    Amrith <amrith@programmer.net> wrote:
    >How can we know when a file is locked using flock system call in linux.
    Try to lock it using flock().

    --
    Barry Margolin, [email]barry.margolin@level3.com[/email]
    Level(3), Woburn, MA
    *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
    Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
    Barry Margolin Guest

  4. #3

    Default Re: File Lock

    Amrith wrote:
    > How can we know when a file is locked using flock system call in linux.
    >
    > Thanks
    I'm going to guess that you mean 'whether a file is locked as a result
    of a call to flock'. Use flock to try and lock it with a different
    process. man flock.

    -- ced

    --
    Chuck Dillon
    Senior Software Engineer
    NimbleGen Systems Inc.

    Chuck Dillon Guest

  5. #4

    Default Re: File Lock

    On 8 Jul 2003 00:02:46 -0700, Amrith <amrith@programmer.net> wrote:
    > How can we know when a file is locked using flock system call in linux.
    >
    > Thanks
    >
    Others have answered... but it's better in general to use lockf, which is
    standard.

    --Marc
    Marc Rochkind Guest

  6. #5

    Default Re: File Lock

    Marc Rochkind <rochkind@basepath.com> writes:
    >> How can we know when a file is locked using flock system call in linux.
    >Others have answered... but it's better in general to use lockf, which is
    >standard.
    It's better still to use fcntl(), which is mandatory in POSIX.1 (whereas
    lockf() is one of the XSI optional functions).
    --
    Geoff Clare <nospam@gclare.org.uk>
    Geoff Clare Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139