OPen file

OPen file

Postby hag » 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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: OPen file

Postby driessen » 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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: OPen file

Postby ukoenig » Mon Nov 29, 2010 1: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

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: OPen file

Postby hag » Mon Nov 29, 2010 3: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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: OPen file

Postby StefanHaupt » Mon Nov 29, 2010 8:40 am

Harvey,

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

Code: Select all  Expand view
TRY
  OPEN (cDbf) EXCLUSIVE
CATCH
  ? "Dbf already opened"
END
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: OPen file

Postby hag » Tue Nov 30, 2010 12:50 am

Thanks for the help. Got it working.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 96 guests