Main Menu

CFindFile

Started by Paul Squires, September 24, 2019, 10:04:24 PM

Previous topic - Next topic

Paul Squires

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."
Paul Squires
PlanetSquires Software

José Roca

Thanks. Code changed to:


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


Pierre Bellisle

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 ".."