Sign in to follow this  
Followers 0
Zomp

How I obtained the number of file and the list of them before discovering _FileListToArray

2 posts in this topic

#1 ·  Posted (edited)

I'm a very newbie of AutoIt.

Trying to build a simple script, I encountered the problem of obtaining the number of files in some path and the list of them.

At that time, I did not know the existence of _FileListToArray.

So, here is how I solved my problem:

1) runwait to execute "dir /b [path and criteria] >somefile.txt"

2) openfile to open somefile.txt

3) fileread to read in binary mode the full content of such file

4) stringsplit using delimiter @crlf to result an array with the number of files and their names.

Indeed, in my problem I always work with a short list of files, so I am not worried about performance, but after discovering _FileListToArray I wish to know what do you think about this solution. I'm just curious.

Thanks.

Edited by Zomp

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