FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Check if a file is in use
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Check if a file is in use
Posted: Sat Jun 28, 2014 01:41 PM

Hi all,
having a .rt file, is there a low level file function to check if it is open ? I need to know if the file is in use from Microsoft Word or another word processor.

Thank you in advance.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Check if a file is in use
Posted: Sat Jun 28, 2014 01:52 PM
What I do to check if a file is in use :
Code (fw): Select all Collapse
TRY
     FOPEN(cFile)
     MsgInfo("File is NOT in use")
     FCLOSE(cFile)
CATCH
     MsgInfo("File is in use")
END
Good luck.

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: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: Check if a file is in use
Posted: Sun Jun 29, 2014 08:46 PM

It runs, thank you driessen,
just made some small changes:

    handle:=fopen(cfile,16)
    if handle>0
        && is unlocked

else
&& is locked
endif

Best Regards,



Marco Turco

SOFTWARE XP LLP

Continue the discussion