using os.Stat for each file to get the FileInfo structure and therefore the isDir also if the file is a symbolic link
moved IsDir check for symbolic link in isDirOrSymbLinkAsDir