FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OPen file
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
OPen file
Posted: Sun Nov 28, 2010 11:30 PM

Is there a way to determine whether a file in a different directory is open or not?

Thank you

Harvey
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: OPen file
Posted: Sun Nov 28, 2010 11:57 PM

Do you mean : a file opened by someone else ?

In that case, try to open it exclusively. If you can't, the file is opened by someone else.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: OPen file
Posted: Mon Nov 29, 2010 01:24 AM
Harvey,

I don`t know, if You mean a Program ( same ), started / installed from different Directorys ?

there is a brandnew Tool, calls Processexplorer that shows everything You need.
You can kill a running process and much more :
Download : http://blogs.technet.com/b/sysinternals/

Sample :
Background.exe is started twice from different directorys : T_WIN and T_WIN_T



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: OPen file
Posted: Mon Nov 29, 2010 03:28 AM

A user is in directory 1 wants to use a DBF file in directory 2.
How can I find out if its already open in directory 2 and keep out the directory 1 user who wants to use it.?

Thank you

Harvey
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: OPen file
Posted: Mon Nov 29, 2010 08:40 AM
Harvey,

as Michel said, you can try to open the dbf exclusive

Code (fw): Select all Collapse
TRY
  OPEN (cDbf) EXCLUSIVE
CATCH
  ? "Dbf already opened"
END
kind regards

Stefan
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: OPen file
Posted: Tue Nov 30, 2010 12:50 AM

Thanks for the help. Got it working.

Thank you

Harvey

Continue the discussion