Function File() but for hidden files (solved)

Post Reply
User avatar
driessen
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Function File() but for hidden files (solved)

Post by driessen »

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.
Last edited by driessen on Fri Jan 25, 2019 9:53 pm, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Function File() but for hidden files

Post by nageswaragunupudi »

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
User avatar
driessen
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Function File() but for hidden files (solved)

Post by driessen »

Mr. Rao,

Thanks a lot for your help. It works fine.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.09 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Function File() but for hidden files (solved)

Post by James Bott »

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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Function File() but for hidden files (solved)

Post by nageswaragunupudi »

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
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Function File() but for hidden files (solved)

Post by James Bott »

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
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Function File() but for hidden files (solved)

Post by James Bott »

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
Post Reply