Is there an easier way to test if a file system item is a directory than using bitmasks?
I have this code in one of my applications (two second line is actually in a loop over folderItems but for simplicity assume the first element):
Dim folderItems As String() = Directory.GetFileSystemEntries(aFolder)
Dim someDirItem As String = folderItems(0)
Dim fInfo As System.IO.FileInfo = New System.IO.FileInfo(someDirItem)
Dim isDirectory As Boolean = (CInt(fInfo.Attributes) And CInt(FileAttributes.Directory)) > 0
(FileAttributes.Directory is 16).
This works, but is there an easier way than using bitwise AND with 1000 (base 2)?