qwert

Can _FileListToArrayRec be made to exclude specific directory?

6 posts in this topic

I've been using _FileListToArray more and more.  But I'm finding that files in a C:\OEM ("manufacturer's") directory show up, but have no bearing on what I'm processing ... and sometimes even files on C:\Windows.

 

What is a practical way to exclude those results?  (I can live without ever seeing anything on either path, if the method has to be built in at a low level.)

I'm familiar with $FLTAR_NOHIDDEN, which excludes $Recycle.bin ... and $FLTAR_NOSYSTEM, which takes care of volume info, etc. (but not \Windows).

Can directories be forced "hidden"?  Or do I have to post-process the resulting array to remove unwanted elements?

Thanks in advance for suggestions.

 

OEM Dir.PNG

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

From the help file for _FileListToArrayRec, $sMask Parameter

[optional] Filter for result. Multiple filters must be separated by ";"
Use "|" to separate 3 possible sets of filters: "Include|Exclude|Exclude_Folders"
    Include = Files/Folders to include (default = "*" [all])
    Exclude = Files/Folders to exclude (default = "" [none])
    Exclude_Folders = only used if $iRecur = 1 AND $iReturn <> 2 to exclude defined folders (default = "" [none])

 

Edited by Subz

Share this post


Link to post
Share on other sites

Did you have a look at parameter $sMask in the help file?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Good point.  I've used it 100 times—even with some complicated include/exclude patterns—and had forgotten about the Exclude Folders.

Thanks for reminding me.  I'm a big fan of Simple.  Yet I was all the way down in File.au3 looking at how the calls are processed.  Another wake up call to the fact that 9 times out of 10, AutoIt already has the feature.

 

 

 

 

Share this post


Link to post
Share on other sites

You can be sure that if something was created by Melba23 then it has all the features you'll ever need ;)

2 people like this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I don't see the feature to get my midnight snack. Melba32 needs to figure that one out asap.

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