Results 1 to 5 of 5

Thread: serious file locking question

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    4

    Angry

    Hi. I'm working on a project that modifies a data file used by another program. I always get "file in use" or "sharing error" whenever I try to write to the file. I imagine this is because the other program has locked the file... is there any way to "un-lock" the file and make it available to my program for modifying it?

    I don't know if it is possible, but I would like it if it could be. I am not interested in using code that will terminate the other program.

    - vb newbie

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The usual case is not that the other program has specifically locked the file, but because it has the file open for reading/writing, which immediately prevents any other programs from accessing it.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    4

    yeah but

    Oh. I have no clue whether it has locked it or what, but I would like to be able to access the file -- is this possible?

    Would it instead be possible to Open the file with my program and set the Shared setting so that both programs could modify it? (or would that still not work if both were accessing it)

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It won't make any difference, I'm afraid. Think about it...the other program is writing to the file while your program's reading. How do you tell what data your program will get? Is it the data from before or after? Or is it parts of both? It's impossible to tell.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    4

    yeah

    actually the program is a game that uses a data file that needs to be modified to play different missions. The game only reads from the data file, and I need to be able to write to it.

Posting Permissions

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



Click Here to Expand Forum to Full Width