PlanetSquires Forums

Support Forums => WinFBX - Windows Framework for FreeBASIC => Topic started by: Paul Squires on September 24, 2019, 09:34:24 PM

Title: CFindFile
Post by: Paul Squires on September 24, 2019, 09:34:24 PM
Hi Jose,

From an email that I received....

"In the CFindFile class, the IsDots function flagged a file named .1%.jpg
Probably a bad idea to have a file beginning with a dot, so I renamed it.
Nevertheless, the IsDots function should not have returned true."
Title: Re: CFindFile
Post by: Josť Roca on September 24, 2019, 10:43:05 PM
Thanks. Code changed to:

Code: [Select]
PRIVATE FUNCTION CFindFile.IsDots () AS BOOLEAN
   IF (m_FileInfo.dwFileAttributes AND FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY THEN
      IF m_FileInfo.cFileName = "." OR m_FileInfo.cFileName = ".." THEN RETURN TRUE
   END IF
END FUNCTION
Title: Re: CFindFile
Post by: Pierre Bellisle on September 25, 2019, 10:18:55 AM
Just for the record: If a filename can legally begin with a dot,
it is interesting to note that it can't end with that character,
except, of course, for "." and ".." folders.
So...
IF ASC(FileName, LEN(FileName)) = 46 THEN this is either "." or ".."