hidden & system files.

BlitzMax Forums/BlitzMax Programming/hidden & system files.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This should work:

SuperStrict

?Win32
Import Pub.Win32	'Import WinAPI Libraries and Functions
?

Print IsFileHidden("C:\Temp\icon.ico")

Function IsFileHidden%( pFilepath$ )
	?Win32
	If (GetFileAttributesW( pFilePath) & FILE_ATTRIBUTE_HIDDEN) Then Return True
	?
EndFunction

Function IsSystemFile%( pFilepath$ )
	?Win32
	If (GetFileAttributesW( pFilePath) & FILE_ATTRIBUTE_SYSTEM) Then Return True
	?
EndFunction
I should perhaps point out that the function is only available on Windows 2000/XP/Vista PCs and so will not work on Windows 9X/NT.