Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Display the Folder or directory size Coldfusion Application

Posted on 2008-06-26
3
Medium Priority
?
346 Views
Last Modified: 2010-04-21
How do I obtain the folder size or the size of a directory I'm reading using cfdirectory?

I need to display the folder size or directory size
0
Comment
Question by:sweetbuttercup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
James Rodgers earned 2000 total points
ID: 21878324
do you want it to be recuursive and do all subdirectories?
this does it from the current directory but easy to change to a dynamic directory start
<cfdirectory action="list" directory="#expandPath('.')#" name="fileList" sort="type,name">
<cfset totalBytes =0>
<cfloop query="fileList">
<cfif #type# is "dir">
<CF_DirSize dirPath="#expandPath('.')#\#name#"> 
<cfset totalBytes =#totalBytes# + #int(evaluate(message/1024))#>
<cfelse>
<cfset totalBytes =#totalBytes# + #int(evaluate(size/1024))#>
</cfif>
<cfoutput>
#attributes.dirPath#,#name#,#size#
</cfoutput>
</cfloop>
<cfset Caller.message = totalBytes>

Open in new window

0
 
LVL 1

Author Closing Comment

by:sweetbuttercup
ID: 31471150
Very nice tag. While searching for CF_DIRSIZE, I actually found CF_FILESEARCH which is a new version of CF_DIRSIZE.  Never heard about them before. Works great!! Thanks a lot!!
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 21882626
glad i could help


thanks for the points
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question