House of Fusion
Home of the ColdFusion Community

Search cf-talk

November 21, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
             1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30             

Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

disk size manager

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Andy/Jacob
Turetsky, Seth
04/14/06 01:38 P

04/14/2006 10:32 AM
Author:
Turetsky, Seth

We just ran out of disk space on a webserver and finding the culprit folder is tough.  Since, we don't have direct access to some drives, it would be nice to have this running under CF since it can access everything :) We wrote a simple file explorer in CF to browse and delete files, but I'd like to have it auto-recurse through all of the folders and subfolders reporting back large ones.  Is there such an app already in CF? -seth ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ==============================================================================

04/14/2006 12:02 PM
Author:
Andy Matthews

ColdFusion 7 has recursion built into cfdirectory I believe. At least I think Dave Watts said something along those lines a week or two back. <!----------------//------ andy matthews web developer ICGLink, Inc. andy@icglink.com 615.370.1530 x737 --------------//---------> We just ran out of disk space on a webserver and finding the culprit folder is tough.  Since, we don't have direct access to some drives, it would be nice to have this running under CF since it can access everything :) We wrote a simple file explorer in CF to browse and delete files, but I'd like to have it auto-recurse through all of the folders and subfolders reporting back large ones.  Is there such an app already in CF? -seth ============================================================================ == Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ============================================================================ ==

04/14/2006 01:41 PM
Author:
Nathan Strutz

Still, that would be a huge pain to do a cfdirectory then count all the filesizes. yuck! Time consuming, too. What you need is the ability to get into the underlying OS, which probably already knows the amount of space you are taking, and have left. Here, I made a little command-line app for you, it runs on .NET 2.0 http://www.dopefly.com/junk/DriveSizeAvailable.zip I'ts really fast, takes one parameter, the drive letter, and spits out the drive space available on the given drive. I made it in 5 minutes, so YMMV, but it worked for me, even on network drives :)  Oh, .NET 2.0 can be found via windows update. Windows only (unless you can get it to work on mono) -nathan strutz http://www.dopefly.com/ On 4/14/06, Andy Matthews <andy@icglink.com> wrote:

04/14/2006 01:04 PM
Author:
Nathan Strutz

Hah, I totally misunderstood the original post. Fun times. So yeah, CF7 has recursive cfdirectory. If you're on 6, you can probably find a function on cflib to recurse through a directory. Just modify it to delete everything it finds :) -nathan strutz http://www.dopefly.com/ On 4/14/06, Nathan Strutz <strutz@gmail.com> wrote:

04/14/2006 01:08 PM
Author:
Munson, Jacob

> ColdFusion 7 has recursion built into cfdirectory I believe. You are correct: http://coldfusioncookbook.com/entry/79/How-do-I-find-the-size-of-a-direc tory? (I just noticed that the cfcookbook as questionmarks in the URLs...weird (as punctuation, not a url param).  That seems dangerous.) -------------------- [INFO] -- Access Manager: This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.  Thank you.   A2

04/14/2006 01:38 PM
Author:
Turetsky, Seth

Andy/Jacob Very handy, but I'm using BlueDragon.  Tried it out of curiosity, but it just listed the current directory. Will inquire with NewAtlanta about it. Thanks this would save time. > ColdFusion 7 has recursion built into cfdirectory I believe. You are correct: http://coldfusioncookbook.com/entry/79/How-do-I-find-the-size-of-a-direc tory? (I just noticed that the cfcookbook as questionmarks in the URLs...weird (as punctuation, not a url param).  That seems dangerous.) -------------------- [INFO] -- Access Manager: This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.  Thank you.   A2

04/14/2006 03:22 PM
Author:
Munson, Jacob

As someone else mentioned, I think what you need to do is best handled by the OS.  You can probably do something with CF, but it's probably going to be time consuming and inefficient.  If you're on Linux, you can use the du command in a script, and call this with cfexecute.  I'm not sure if there's anything that handy in Windows land... [INFO] -- Access Manager: This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.  Thank you.   A2

04/17/2006 08:33 PM
Author:
Denny Valliant

Well, I'm not so cool as to whip up an example, but you could easily use Java to interact with the File System. Generally it's quite a bit faster at FS stuff than CF (or BD, I'd assume). Heck, I'll go check for a java directory size example...  hrm. found some JNDI: JRun and Sun's JNDI FS http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_17957 ** I tried to use the java built in stuff to bypass CF's cfdirectory, but doing a file by file check (needed to get folder size) was waaaay slower.  Maybe with a FileFilter for directories it would be faster... neh. Nothing as fast as the native OS I bet. I did find a couple of blog posts stating that the java.io.file method of listing the directory was faster than the cfdirectory command, by more than an order of magnitude, so, if you don't need sizes and whatnot (you do, so nix that)... Eh. Much as I dislike it in practice, cfexecute is your friend here I think. :D -ps I did get a working "cfdirectory" via the java.io.file, if anyone is interested, but it's pretty pointless cuz cfdir was 79ms vs. 8765ms for the java only one that tallies folder size (both recursive on same dir). I did like the idea the blogger(something "b"? barry?) had about using the java vs. cfdirectory. Find orphan files faster than with cfdirectory at least. [-= But definitely not file sizes. Bleh! On 4/14/06, Munson, Jacob <JMunson@idahopower.com> wrote:

04/16/2006 03:45 AM
Author:
Turetsky, Seth

The problem is we don't have access to our production servers, but CF has full access to the drives. I didn't see this post you mentioned, my email is whacky today so I apologize to anyone if it seems that I ignored their help -seth As someone else mentioned, I think what you need to do is best handled by the OS.  You can probably do something with CF, but it's probably going to be time consuming and inefficient.  If you're on Linux, you can use the du command in a script, and call this with cfexecute.  I'm not sure if there's anything that handy in Windows land... [INFO] -- Access Manager: This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.  Thank you.   A2


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists