Results 1 to 2 of 2

Thread: telling if another program is using a file [edit]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    81

    telling if another program is using a file [edit]

    i need to tell if a certian program is using a certian file

    the program is a game and the files i need to see if it is using are maps. when the program changes maps, it opens the corresponding map file.

    i thought about having a file list box in the map directory and having a loop that tries to open the map, but it turns out that the "Open mapfilename for input as #1" still works when the game has the file open.

    so basically, how do i check if a file is being used by another program.

    i dont really need to know if the certian program has the file open, just if the file is in use at all.


    thanks
    stuart
    Last edited by StuartC; Jun 16th, 2004 at 10:00 PM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Posts
    81
    nevermind sorry i found a solution

    VB Code:
    1. On Error GoTo errHandle
    2.  
    3.   Open "C:\book1.xls" For Binary Lock Read As #1
    4.  
    5.   Close #1
    6.  
    7.   Exit Sub
    8.  
    9. errHandle:
    10.   If Err.Number = 70 Then
    11.     MsgBox "Cannot open file.", vbExclamation
    12.   End If

    sorry again

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