
function is_file ( byval somePathToTest as string ) as long

	is_file = FileExists ( somePathToTest ) : Exit Function

end function

function is_dir ( byval somePathToTest as string ) as long

		'return Values as written on wikiDoc 6.8.2016

 '0 -> folder exists		Other Values -> NON existing folder

		Dim As String whereWecall=curdir

		Dim As long result=-1

 result=ChDir ( somePathToTest )	'try to change a folder

 ChDir ( whereWecall)				'return to calling point ! MUST BE

		is_dir = result : Exit Function

end function

/'
Print "DevKit v6.1 Core / Cat"
Flip : WaitKey ( )
End
'/

Sub Cat ( FileList ( Any ) As String, Path As String = ".\*.*", Attr As Long = fbNormal )

	Erase FileList

	'Print "Cat: " & QUOT & Path & QUOT

	Dim As String sFile

	sFile = Dir ( Path, Attr )

	Do While Len ( sFile ) > 0

		'Print "sFile: " & QUOT & sFile & QUOT
		Select Case sFile
		Case ".", ".."
		Case Else
			ReDim Preserve FileList ( LBound( FileList, 1 ) To UBound( FileList, 1 ) + 1 )
			FileList ( UBound ( FileList, 1 ) ) = sFile
		End Select

		sFile = Dir ( )

	Loop

	'Print "Cat found " & ( UBound ( FileList ) + 1 ) & " FileList."

End Sub
