Visual Basic 6 function "is_dir"

Go back

Below you'll find the source for the Visual Basic 6 function is_dir.

Attribute VB_Name = "modIsDir"
' This function is downloaded from:
' http://www.stefanthoolen.nl/archive/vb6-functions/
' 
' You may freely distribute this file but please leave all comments, including this one, in it.
' 
' @Author Stefan Thoolen <mail@stefanthoolen.nl>

''
' Tells whether the filename is a directory
' Same syntax as the PHP function 'is_dir'
' See also: http://www.php.net/manual/en/function.is-dir.php
' Dependency: Scripting.FileSystemObject (.NET Framework 2.0)
' @param    String  filename        The dir/filename to check
' @return   Boolean                 True if it's a folder, false if it's not
' @author   Stefan Thoolen <mail@stefanthoolen.nl>
Public Function is_dir(filename As String) As Boolean
    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    is_dir = fso.FolderExists(filename)
    Set fso = Nothing
End Function