FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Function File() but for hidden files (solved)
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Function File() but for hidden files (solved)
Posted: Fri Jan 25, 2019 08:25 PM

Hello,

I need to check if a hidden file exist of not.
Since the function File() doesn't check hidden files, this can't be used.

How can I check if a hidden file exists ?

Thank you in advance for any help.

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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Function File() but for hidden files
Posted: Fri Jan 25, 2019 08:53 PM

With xHarbour, File( cHiddenFile ) returns .T.
But with Harbour, it returns .F.

We can use !Empty( DIRECTORY( cHiddenFile, "H" ) ) in both (x)Harbour

Regards



G. N. Rao.

Hyderabad, India
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Function File() but for hidden files (solved)
Posted: Fri Jan 25, 2019 09:54 PM

Mr. Rao,

Thanks a lot for your help. It works fine.

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: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Function File() but for hidden files (solved)
Posted: Mon Jan 28, 2019 07:47 PM

A thought just occurred to me, can we access DBFs and indexes that are hidden? This would prevent users from messing with these files.

Andi if so, can we create hidden files from code?

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Function File() but for hidden files (solved)
Posted: Tue Jan 29, 2019 01:04 AM
James Bott wrote:A thought just occurred to me, can we access DBFs and indexes that are hidden? This would prevent users from messing with these files.

Andi if so, can we create hidden files from code?


Big YES.
Good idea is to hide the folder even.
Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Function File() but for hidden files (solved)
Posted: Tue Jan 29, 2019 01:56 AM

Great news.

Does FW just see them when we try to open them, or is there special syntax?

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Function File() but for hidden files (solved)
Posted: Tue Jan 29, 2019 01:59 AM

Ok, I just tried hiding a folder and it's contents and the EXE still sees it.

I like it!

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion