greetings from Iceland!
To begin with, I have searched both with google and here with no result.
I'm writing in Delphi and have couple of years experience in Delphi (over 30 years in Pascal)
I have build over these years variety of files utility's programs and used the functions FindFirst and FindNext in almost every such app. Today I was using a old file-utility program I wrote and found out it didn't work 100%
It was ok until the directory name got somehow strange, i.e. name with couple of periods inside. The story is I was installing Wamp and some folders there was named with this strange method.
As: "c:\wamp\apps\phpmyadmin3.4.5"
"c:\wamp\apps\sqlbuddy1.3.3"
"c:\wamp\apps\webgrind1.0 etc"
When I did debugging, I found out Findnext just returned error 18 which is same error as FindNext return when no more files is to find.
I have tried FindFirstFile and FindNextFile with same result. I'm thinking to try API FindNextFileEx, if this has to do with long file names, but not so optimistic..
Also I notice the attribute in these folders wasn't 16 (hex10) instead it was 8208 (8192+16), but it doesn't have anything to do with this problem as I could for example mask (AND) the attr with $00FF etc.
PROCEDURE TForm_Leit.Finna_Dir (Str_InnDir : STRING);
VAR
S_Rec1 : TSearchRec;
Bo_Buid : BOOLEAN;
BEGIN
.
.
.
//Find Dir part
IF (FindFirst (Str_Inndir+'\*.', faDirectory, S_Rec1) = 0) THEN
REPEAT
Bo_Buid := FALSE;
IF ((S_Rec1.Name = '.') OR (S_Rec1.Name = '..')) THEN
REPEAT
Bo_Buid := FindNext (S_Rec1) <> 0;
UNTIL NOT((S_Rec1.Name = '.') OR (S_Rec1.Name = '..')) OR (Bo_BUid);
IF NOT(Bo_Buid) THEN
Finna_Dir (Str_Inndir+'\'+S_Rec1.Name); //Recursion
UNTIL (FindNext (S_Rec1) <> 0);
END;