Sign in to follow this  
Followers 0
lupusbalo

a "Browse Then Do" acting on each file found

2 posts in this topic

#1 ·  Posted (edited)

with some help from you guys, I tried (and hopefully succeed :lmao: ) 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 o:)

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 :whistle: )

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 by lupusbalo

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I feel again another speed contest coming.. :lmao:

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 by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0