Jump to content

Can _FileListToArrayRec be made to exclude specific directory?


qwert
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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

 

 

 

 

Link to comment
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 ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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...