1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? A probably stupid question re "@Files" and Include Lists...

Discussion in 'Support' started by mathewsdw, Apr 21, 2012.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    I'd like to know the total number of files in a directory tree that match any of of several wild-card patterns. So there is no doubt or obfuscation whatsoever, what I am trying to do is to count the number of .mp3 and .wma files in a directory tree. Specifically,
    Code:
    Echo %@Files[/S D:\Multi-Media\Music\Sources\*.mp3;*.wma]
    
    doesn't work.

    Now the result of the command with just ".mp3" is 3454, with just ".wma" is 26, so I would expect the result of the above to be 3480. However, the result of the above is just 26, and if I reverse the "*.mp3" and "*.wma" the result is just 3454, what you would expect given that the immediately previous doesn't work.

    And, oddly enough,
    Code:
    Echo %@Files[/S D:\Multi-Media\Music\Sources\*.mp3 D:\Multi-Media\Music\Sources\*.wma]
    
    gives 817(????).

    Now I am perfectly aware that:
    Code:
    Echo %@Eval[%@Files[/S D:\Multi-Media\Music\Sources\*.mp3]+%@Files[/S D:\Multi-Media\Music\Sources\*.wma]]
    
    will get the job done. But it also takes significantly (and therefore noticeably longer) than looking for just one file type, presumably because it is scanning the directory tree twice. (And since I will be ultimately looking for 4 file extensions, 4 times longer.)

    Certainly not the end of the world; and it is admittedly a somewhat academic question in that there is a workable (and not very complicated) solution. However, I'd still like to know why what I thought would work does not work on general principles alone.
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,959
    Likes Received:
    30
    Something does appear to be amiss. These are correct:

    Code:
    c:\windows\media> echo %@files[*.mid]
    3
    c:\windows\media> echo %@files[*.wav]
    43
    c:\windows\media> echo %@files[*.wav;*.mid]
    46
    And these differ (!), the second one being correct:

    Code:
    c:\windows\media> echo %@files[/s *.wav;*.mid]
    46
    c:\windows\media> echo %@files[/s *.mid;*.wav]
    306
     
  3. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Rex, Vince (immediately previous) also managed to duplicate the problem, so it's not just my imagination. Since you are clearly awake and on this bulletin board, could you please fix the problem? While the work-around isn't that difficult (other than to be somewhat time-consuming) I find it to be a significant annoyance (one of very few that this product has!). And if you can't (easily?) fix it, could you please update the docs so that the docs for "@Fields" doesn't say it supports "include lists"? - Dan
     

Share This Page