Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


delphi subfolder =(

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Sep 09, 2007 3:15 am    Post subject: delphi subfolder =( Reply with quote

how do i make it search all folders from the path ? (include subfolder)

Quote:

procedure TForm1.SpeedButton2Click(Sender: TObject);
var
APath: string;
MySearch: TSearchRec;
begin
APath:=Edit3.Text; // <<<< C:\ (start folder)

FindFirst(APath+'\'+edit4.text, faAnyFile, MySearch); //C:\New Folder + \ + file name (i could fix it better but i got it on the net -.-)

Memo2.Lines.Add(MySearch.Name); // add file to memo2

DeleteFile(APath+'\'+MySearch.Name); // delete file

while FindNext(MySearch)=0 do // search next file

begin
Memo2.Lines.Add(MySearch.Name); // add new file to memo2
DeleteFile(APath+'\'+MySearch.Name); // delete next file

end;
FindClose(MySearch);
end;




_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Sep 09, 2007 7:18 am    Post subject: Reply with quote

You'll want to make the FindFirst function an if loop
Code:

if FindFirst(APath+'\'+edit4.text, faAnyFile, MySearch) = 0 then
 begin
 repeat
 memo1.lines.add(MySearch.Name)
 until FindNext(MySearch) <> 0
 FindClose(MySearch);
 end;


now to get subfolders you want to search the MySearch.Name once you receive it and then search that and everything after, until no files are left, then move on to the next folder.

but the problem is it searchs files too which will break the function early.

i dont really feel like writing it but google it, theres a few examples...

also the DeleteFile function makes it look malicious, unless it does something i don't know about.

_________________
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Sep 09, 2007 12:28 pm    Post subject: Reply with quote

blankrider wrote:
You'll want to make the FindFirst function an if loop
Code:

if FindFirst(APath+'\'+edit4.text, faAnyFile, MySearch) = 0 then
 begin
 repeat
 memo1.lines.add(MySearch.Name)
 until FindNext(MySearch) <> 0
 FindClose(MySearch);
 end;


now to get subfolders you want to search the MySearch.Name once you receive it and then search that and everything after, until no files are left, then move on to the next folder.

but the problem is it searchs files too which will break the function early.

i dont really feel like writing it but google it, theres a few examples...

also the DeleteFile function makes it look malicious, unless it does something i don't know about.



well idk what "malicious" mean but i try make a clean up my pc program =p

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Sep 09, 2007 12:33 pm    Post subject: Reply with quote

malicious = virus

and you could just right click > delete

_________________
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Sep 09, 2007 12:50 pm    Post subject: Reply with quote

blankrider wrote:
malicious = virus

and you could just right click > delete



yea i could right click and delete -.- if i whant to search for a file with exampel *.tmp or something it is probably easyer to search for them and auto delete instead of right click and look for them self Cool

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites