Jump to content

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


Zomp
 Share

Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...