Hi folks.
I'd like to know how to walk thru a FileTree made from this:
StarBurn_ISO9660JolietFileTree_Create(FTrack, PCHAR(@ErrorText[1]), sizeof(ErrorText), Status,
@SitaBurnerCallback, @FTrackContext, TRUE,
FALSE, // No locked files - do not keep all the handles opened all the time
TRUE, // Use Level2 for ISO9660 names generation
FTrackType);
in which I need to remove some files matching a defined pattern.
I currently use a loop like this one:
procedure ScanDirectory(Track, DirNode: Pointer; FileMask: string);
// procedure recursive ************************
var
NewNode: Pointer;
Attributes: Integer;
FileName: string;
begin
FileName := GetNodeFileName(Track, DirNode);
NewNode := StarBurn_ISO9660JolietFileTree_GetFirstKid(FTrack, DirNode);
while NewNode <> nil do begin
FileName := GetNodeFileName(Track, NewNode);
Attributes := StarBurn_ISO9660JolietFileTree_GetAttributes(FTrack, NewNode);
if (Attributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY then
ScanDirectory(Track, NewNode, FileMask)
else
TestAndDeleteFile(Track, NewNode, FileMask);
NewNode := StarBurn_ISO9660JolietFileTree_GetNextKid(Track, DirNode, NewNode); end;
end;
But I'm suspicious
about the selected line above as it gives the next node but appears to ignore directories.
Something wrong with it ?
Please note that code is DELPHI and this function is recursive and this may be the answer.
My need is to have a working logic so that I can go thru ALL nodes in the tree.
Tanks a lot
Antonio.