Richard,

I do this kind of stuff with a Q of Q, and it works well. cfdirectory returns a query.
Maybe try that.

Something like:

<cfdirectory directory="#pDir1#" action="" name="daList">
<cfquery name="daSortedList" dbtype="query">
SELECT *
FROM daList
WHERE Type = 'File'
AND Name Like 'les%'
</cfquery>
<cfset p = "#daSortedList.RecordCount#">

check my syntax tho' ...

nando
-----Original Message-----
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 02, 2004 10:02 PM
To: CF-Talk
Subject: Re: Number of files in a directory

This is off the top of my head, so I could be wrong, but I believe that
"filter" only filters by extension.

Assuming this is true, you could either filter the list in CF or use a
DOS command like "dir /b les*.* > les_list.txt", use cffile to read it
in, and then treat it like a linefeed-delimited list.

--Ben Doom

Richard Crawford wrote:

> If I'm right, then this code snippet..
> =================================================
> <cfdirectory directory="#pDir1#" action="" name="daList" sort="name"
> filter="les*">
> <cfset p = "#daList.RecordCount#">
> =================================================
>
> would return to p the number of files in the directory pDir1 where the
> filenames start with the characters "les".
>
> Obviously, though, I'm not right, because p never gets a value other than 0.
>
> What am I doing wrong?
>
> --
> Richard S. Crawford
> Programmer III,
> UC Davis Extension Distance Learning Group (http://unexdlc.ucdavis.edu)
> (916)327-7793 / [EMAIL PROTECTED]
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to