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

May 24, 2010
855
0
Northlake, Il
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.
 
May 20, 2008
11,380
98
Syracuse, NY, USA
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
 
May 24, 2010
855
0
Northlake, Il
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
 
Similar threads
Thread starter Title Forum Replies Date
M A probably stupid question about .btm file argument parsing... Support 6
M I'm probably wasting my time re a fairly consistent and significant TCC misbehaviour, but... Support 4
M A possibly stupid question about the "del" command... Support 7
A Stupid, obvious question - launch a BAT with TC Support 10
M Maybe Maybe I'm being stupid (again), but a simple question... Support 4
M How to? A seemingly-stupid question related to the "Shift" command. Support 2
C forum Posting Question... Support 3
C question re: Move Support 3
S How to? Upgrade Question: What supporting documentation is required at time of purchase? Support 2
Peter Murschall Documentation Question to %@PSHELL Support 4
Fross Tab Question Support 6
Fross Quick Function Question Support 17
Dick Johnson Question about the Touch command Support 0
rps Documentation "Copy+Paste+run" question Support 2
vefatica SFTP question Support 17
vefatica Question about IPWorks Support 0
C How to? SHORTCUT question..... Support 6
vefatica TPIPE, crash and question Support 1
C Question / Suggestion Support 1
MickeyF Another TPIPE question Support 6
vefatica Another @EVERYTHING question Support 4
mikea How to? %@everything[] question Support 10
A License Question for Single User Support 5
Jay Sage Help Correction (and Related Question) Support 0
S Elapsed time in TCC prompt question Support 0
H command line parsing question Support 5
C Forum question Support 2
B Newbie here, I have a question. Support 4
J Dumb Question ... Support 4
Timothy Byrd Updating from TC 9 to TC 17 - TCTOOLBAR question Support 2
M A just out of curiosity question re @DiskTotal Support 4
Fross Status Bar Time Question Support 1
C How to? GLOBAL question Support 5
vefatica OT: VisualStudio question Support 1
vefatica Wildcard question Support 4
Dan Glynhampton v15 installer question Support 2
C Move question with Encrypted file... Support 6
C Message Board question Support 1
James Miller How to? filename completion question Support 1
C coding question Support 3
M A just-out-of-curiosity question because it's ... Support 6
Frank question to FOLDERMONITOR Support 14
C Dumb titleprompt question Support 4
M Upgrade Question Support 2
S option /u question Support 19
M Just an out-of-curiosity question re. "Do ... /P ..." Support 31
M How to? An admittedly somewhat silly question regarding elevation... Support 2
M Just an out-of-curiosity question the List command vs. the @Lines function... Support 13
M PDir format question... Support 3
M A question about file compression that is just out of curiosity... Support 2

Similar threads