Is this file locked?

Discussion in 'Ruby' started by E. Mark Ping, Nov 10, 2007.

  1. E. Mark Ping

    E. Mark Ping Guest

    Is there an easy ruby way to tell if a file is locked? I can lock a
    file using File.flock, but I have a file which may have a shared lock
    and I don't want to mess with it unless no one else is locking it (and
    grabbing an exclusive lock screws up the program that's creating the
    file).

    I'm on WinXP, so a solution using WIN32API would be acceptable.
    --
    Mark Ping
     
    E. Mark Ping, Nov 10, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Kamoski
    Replies:
    1
    Views:
    2,454
  2. MrB
    Replies:
    1
    Views:
    2,180
  3. Keith
    Replies:
    0
    Views:
    532
    Keith
    Oct 1, 2003
  4. hkappleorange

    database file locked by aspx

    hkappleorange, Nov 6, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,727
  5. mishi_math
    Replies:
    11
    Views:
    15,599
    mishi_math
    Aug 26, 2003
Loading...

Share This Page