Function File() but for hidden files (solved)

Function File() but for hidden files (solved)

Postby driessen » Fri Jan 25, 2019 8: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.
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.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: Function File() but for hidden files

Postby nageswaragunupudi » Fri Jan 25, 2019 8: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
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby driessen » Fri Jan 25, 2019 9: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. 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: Function File() but for hidden files (solved)

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

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

Postby nageswaragunupudi » Tue Jan 29, 2019 1: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
User avatar
nageswaragunupudi
 
Posts: 10655
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby James Bott » Tue Jan 29, 2019 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

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

Postby James Bott » Tue Jan 29, 2019 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 40 guests