Reply to Thread

Post a reply to the thread: Check if file over network is in use?

Your Message

Click here to log in

What's the name of our main installation product (in uppercase letters), directly followed by the current year?

 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 03-16-2011, 10:02 AM
    linder

    Re: Check if file over network is in use?

    Assuming that the file/folder information is correct, it's a permission problem (IMO)

    Friedrich
  • 03-16-2011, 09:59 AM
    linder

    Re: Check if file over network is in use?

    It's very simple. The CreateFile Windows API to open the file returns INVALID_HANDLE_VALUE. That means the \\server2900\fpa\fpuser.dat file is not available (file not found) or the network share is not accessible (in fact, that also means 'file not found').

    Just for fun, try the "If File/Folder..." script function to check if the file exists and I am sure you'll get the same result.

    Perhaps a permission problem!?

    Friedrich
  • 03-16-2011, 09:55 AM
    arrigob

    Re: Check if file over network is in use?

    Just saw your last post, I am going to play around on that. I am using a Windows 7 machine to connect to a windows 2003 server.
  • 03-16-2011, 09:48 AM
    arrigob

    Re: Check if file over network is in use?

    ? That is weird.

    I also just tried the same function but this time I told I used the actual network path \\server2900\fpa\fpuser.dat. This also returned -1, but I can physically see the file in that location? Any ideas, I'm still playing with it too.
  • 03-16-2011, 09:48 AM
    linder

    Re: Check if file over network is in use?

    BTW, and if this is a mapped drive on an UAC-aware operating system, make sure that the mapped drive is 'accessible' by your process.

    http://www.lindersoft.com/forums/showthread.php?t=31410

    Friedrich
  • 03-16-2011, 09:45 AM
    linder

    Re: Check if file over network is in use?

    Brandon,

    '-1' means "File not found" here. That means, you point to an incorrect file location.

    Friedrich
  • 03-16-2011, 09:36 AM
    arrigob

    Re: Check if file over network is in use?

    Hey,

    I return a -1 when using that function. I am also telling it to check %DATAPTH%\fpuser.dat. Is that my problem. I do not know what the end users network path will be but I do know that this variable will always have the path to the shared data folder on their network.

    Brandon
  • 03-16-2011, 08:57 AM
    linder

    Re: Check if file over network is in use?

    Brandon,

    Does the "Check In-use File..." function not work in your case?

    I checked the following:

    Set Variable %INUSE% to FUNCTION:Check In-use File "\\Win7-64\Corpdata\test.dat"

    The 'test.dat' file was located on another machine and was locked (in-use) and the function returned '1'.

    Friedrich
  • 03-16-2011, 08:19 AM
    arrigob

    Check if file over network is in use?

    Hi there,

    In our software, you run the program locally and pull data from another area on the network. We want to make sure that no users are working in our software when they run one of our updates. We have a file labeled fpuser.dat that would be in use if at least one person is signed in to our program. The only problem is that the fpuser.dat file is located on the network and not locally. Is there a way to check and see if the file is in use on a network?

    If this is not possible, do you know of a way to accomplish something like this. We are worried that a user being logged in during an update that includes dictionary changes could be harmful to their data files. Any help would be wonderful. Thanks, as always!

    Brandon

Posting Permissions

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