Quantcast
Channel: Indigo Rose Software Forums - Forums
Viewing all articles
Browse latest Browse all 2105

unable to get this piece of code right

$
0
0
i'm having a hard time getting this right. I am using folder.find to delete folders NOT found in another table but i am getting nowhere. The goal is is to delete ALL folders under "c:\temp" EXCEPT "c:\temp\test1", "c:\temp\test2" and "c:\temp\test3"

Code:

tNowList = Folder.Find("c:\\temp", "*", false);
tThenList = {"c:\\temp\\test1","c:\\temp\\test2","c:\\temp\\test3"};
for j, k in pairs (tNowList) do
        if not (k == tThenList[j]) then
                Folder.DeleteTree(tNowList[j]);
        end
end


Viewing all articles
Browse latest Browse all 2105

Trending Articles