Use CFDIRECTORY and return the results to the QUERY attribute. The query
contains a bunch of information about the files in the directory. Then do a
".recordcount" on the query variable, subtract 2 if you're in an NT world
(to account for the "." and ".." control directories, and you've got the
count:

<CFDIRECTORY ACTION="LIST" DIRECTORY="#directory_path#" NAME="the_dir">

<CFSET num_of_files=the_dir.recordcount-2>
<CFOUTPUT>There are #num_of_files# in the directory.</CFOUTPUT>

Hope this helps!

-Steve Goldenberg
Interfolio.com
4300 Old Dominion Dr.
Suite 901
Arlington, VA 22207
p: 703.522.4004
f: 209.315.7319

-----Original Message-----
From: Gregory Weiss [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 24, 2000 1:32 PM
To: '[EMAIL PROTECTED]'
Subject: Obtain # of Files in a DIRECTORY


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01BFAE13.01D459EE
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I need to get a count of the number of files in a particluar =
directory.=A0 I
know that CFFILE allows you to do several FILE operations, but how =
would you
actually get a count of the number of files that exist in a particular
directory.
=A0
Thanks in advance for your help.
=A0
Gregory L. Weiss
Web Development Project Leader
Trapezoid, Inc.
4107 Laguna Street
Coral Gables, Florida 33146
(305) 442-8060 x230
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
=A0

------_=_NextPart_001_01BFAE13.01D459EE
Content-Type: text/html;
        charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=690004717-24042000>I need to get a
count of the number of files in a particluar directory.&nbsp; I know that
CFFILE
allows you to do several FILE operations, but how would you actually get a
count
of the number of files that exist in a particular
directory.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=690004717-24042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=690004717-24042000>Thanks in
advance
for your help.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=690004717-24042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><STRONG><EM>Gregory L.
Weiss</EM></STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2>Web Development Project Leader</FONT></DIV>
<DIV><FONT face=Arial size=2>Trapezoid, Inc.</FONT></DIV>
<DIV><FONT face=Arial size=2>4107 Laguna Street</FONT></DIV>
<DIV><FONT face=Arial size=2>Coral Gables, Florida 33146</FONT></DIV>
<DIV><FONT face=Arial size=2>(305) 442-8060 x230</FONT></DIV>
<DIV align=left><FONT face=Arial size=2><A
href="mailto:[EMAIL PROTECTED]"><STRONG>[EMAIL PROTECTED]</STRONG></A>
</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01BFAE13.01D459EE--
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to