lupusbalo Posted February 6, 2005 Share Posted February 6, 2005 (edited) with some help from you guys, I tried (and hopefully succeed ) to make a "Browse Then Do" function which browse a given directory (and sub dir) and act upon each found file using a user defined function invoked via "Call"Global variables allow "simulation" of passing parameters within function called.Most of the code to walk thru dir is taken from jos van der Zande's findfiles.au3 (find somewhere in forum or examples). THX to him I initialy considered this script as an exercise do deal with full callback implementation, but it obviously has interest in itself as it runs far much faster than jos's code sorry jos (1/5 cpu, 1/6 elapsed time on a 10 000 file dir !!) if time is critical and/or "big" directories are to be scanned, this could be helpful.On the other hand it is not self contained (waiting for function parameter in call ) from this "source management" point of view jos's work is far much better! the user function "dofunction" being defined somewhere, the browse is invoked via$dummy=_BrowseThenDo ($dir,$mask,$dofuncname) make up your own mind with the attached file (need to change initial dir and logfile to YOUR specs)<<whearas i didn't found something similar on the forum, let me know if i'm wrong>>test_new_findfiles.au3 Edited February 6, 2005 by lupusbalo Link to comment Share on other sites More sharing options...
Developers Jos Posted February 6, 2005 Developers Share Posted February 6, 2005 (edited) I feel again another speed contest coming.. Mine wasn't written for speed but just to demo how to do recursive file handling in pure AutoIt3 code. If speed is required I would use a simple : Dir *.xyz /s > result.txt Jos Edited February 6, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now