Results 1 to 3 of 3

Thread: Detect file is running or opening??

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    1

    Question Detect file is running or opening??

    Is there a function that it can detect a file (eg. a exe or a txt file ) is running or opening .....

    thx for your reply !!

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Will you know the caption of the program you want to check?

  3. #3
    jim mcnamara
    Guest
    IF it's a data file ( like a .txt) you can use the open command and check for errors on open. An error on open (if you know the file exists) means the file is open by something else

    Code:
    ' assume you know the file DOES exist
    Function  checkTextFile(str as String) as Boolean
    On error goto is_open
    Open strFile for append as #1
    close #1
    checkTextFile = False
    Exit function
    is_Open:
        checkTextFile = True ' means the file IS open
    
    End Function
    usage: If not checkTextFile("myfile.txt") then .... do something

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