How to get folder size in bytes

Hi all,
Is there a easy way to get folder size in bytes?  I don't want to check each file in it and then add them up.
Thanks for any help.
Anne

Years ago, I found my home PC was lacking disk space and could not exaplain where all of the space went.
At the same time I was teaching myslef how to use the Picture control and Windows did not allow you to check the size of a folder and it sub-folders. So I used that situation to learn about the picture control and LV at the same time.
It worked and ran but very slowly.
Soon after Greg McKaskle was putting together the first version of "The Good The Bad and The Ugly" and was looking for fodder to beat up. I offered and he accepted. When the time came for the presentation, my code was chosen as "The bad" since I had not learned how to do a cluster sort at that time so I wrote my own version of a bubble sort (the VI presents a Pie Chart of disk usage and clcik on the sectors of the Pie Chart allowed you to drill down so I hd to sort by sizes).
So why am I telling you this long boring story?
That code is attached for you to look at laugh and tell me how dumb I was.
Feel free to beat me up. It can't be any worse than the abuse I got from Greg (I felt like I was being raped).
Have fun!
Ben
Code is probably 6 or thereabouts. "Disk_Utility" is top level. Remember this is an example of how NOT to code.
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Attachments:
DIsk_Pie_Utility.zip ‏162 KB

Similar Messages

  • How to get image size in bytes

    i have to get image size in bytes and accessing image from the a folder
    Thanks in advance

    If it's going to be accessed as a file on the filesystem, you can use java.io.File.length() to get the size in bytes.
    In other situations...it depends on what you're doing.

  • How to get the number of bytes at TCP port

    Hi all,
    How to get the number of bytes to read at the TCp port...as someone had suggested in some forum we do read the number of bytes first and then pass this...
    but we get a problem when we have FF data in this...because then it sends 2 FF data...and cause of this we skip the last data...is there any solution for the same?

    Hi
    In LabVIEW you don't have the same property as in serail port.
    You havn't "Byte at TCPIP port".
    if you developp a protocol, one soltion, is to send the size to read.
    Ingénieur d'Application / Développeur LabVIEW Certifié (CLD)
    Application Engineer / LabVIEW Certified Developer (CLD)

  • How to get the size of the table

    Hi All,
    How to get the size of the table in Oracle 10g?
    Is there any script which needs to be run?
    Regards,
    Apoorv

    Hi All,
    Sorry but somehow the table user_segments is not populated in my case. But we have another table SYS.ALL_TABLES whose structure is given below. Would I be able to calculate the table size based on the columns given below:
    ColumnName     Data Type
    OWNER     VARCHAR2 (30 Byte)
    TABLE_NAME     VARCHAR2 (30 Byte)
    TABLESPACE_NAME     VARCHAR2 (30 Byte)
    CLUSTER_NAME     VARCHAR2 (30 Byte)
    IOT_NAME     VARCHAR2 (30 Byte)
    STATUS     VARCHAR2 (8 Byte)
    PCT_FREE     NUMBER
    PCT_USED     NUMBER
    INI_TRANS     NUMBER
    MAX_TRANS     NUMBER
    INITIAL_EXTENT     NUMBER
    NEXT_EXTENT     NUMBER
    MIN_EXTENTS     NUMBER
    MAX_EXTENTS     NUMBER
    PCT_INCREASE     NUMBER
    FREELISTS     NUMBER
    FREELIST_GROUPS     NUMBER
    LOGGING     VARCHAR2 (3 Byte)
    BACKED_UP     VARCHAR2 (1 Byte)
    NUM_ROWS     NUMBER
    BLOCKS     NUMBER
    EMPTY_BLOCKS     NUMBER
    AVG_SPACE     NUMBER
    CHAIN_CNT     NUMBER
    AVG_ROW_LEN     NUMBER
    AVG_SPACE_FREELIST_BLOCKS     NUMBER
    NUM_FREELIST_BLOCKS     NUMBER
    DEGREE     VARCHAR2 (10 Byte)
    INSTANCES     VARCHAR2 (10 Byte)
    CACHE     VARCHAR2 (5 Byte)
    TABLE_LOCK     VARCHAR2 (8 Byte)
    SAMPLE_SIZE     NUMBER
    LAST_ANALYZED     DATE
    PARTITIONED     VARCHAR2 (3 Byte)
    IOT_TYPE     VARCHAR2 (12 Byte)
    TEMPORARY     VARCHAR2 (1 Byte)
    SECONDARY     VARCHAR2 (1 Byte)
    NESTED     VARCHAR2 (3 Byte)
    BUFFER_POOL     VARCHAR2 (7 Byte)
    ROW_MOVEMENT     VARCHAR2 (8 Byte)
    GLOBAL_STATS     VARCHAR2 (3 Byte)
    USER_STATS     VARCHAR2 (3 Byte)
    DURATION     VARCHAR2 (15 Byte)
    SKIP_CORRUPT     VARCHAR2 (8 Byte)
    MONITORING     VARCHAR2 (3 Byte)
    CLUSTER_OWNER     VARCHAR2 (30 Byte)
    DEPENDENCIES     VARCHAR2 (8 Byte)
    COMPRESSION     VARCHAR2 (8 Byte)
    DROPPED     VARCHAR2 (3 Byte)

  • How to get folder(directory path only not file path) from local file system

    Hi Firends,
    How to get folder(directory path only not file path) from local file system , whenevr i will click on browse button.
    Please give reply for this one , if anybody knows.
    Thanks,
    Anderson.

    Hi Anderson,
    if you're using flash.filesystem.FileReference - then it is run in black box - except of filename, size and creation data (and few other properties available after some operation succeeded). This is part of security features in Flash runtime (described in header section):
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference .html
    This for example implies that user can download a content to local machine - but that content cannot be loaded back into Flash runtime. For this you would need either Air runtime flash.filesystem.File:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml
    (so you would created Air runtime based application: desktop or mobile but not web, even as standalone project) or you would need one of 3rd party tools that add file access/file information features to standard Flash runtime applications converted to standalone native applications.
    hth,
    kind regards,
    Peter

  • How to get the size of driver[C: or D:]

    Hi Friends,
    I have a query regarding to java..
    I want to get the name of all the drives that r connected to the System including network drives...
    and how to get the size of any system drive[For example C: or D: Drive].
    I want the output to be displayed like in the following format
    Device type size free Usage_Space
    for ex.
    C: NTFS 37.5Gb 30.5gb 7gb
    Output like as linux command df -h
    Edited by: KituPrash on Mar 4, 2009 3:29 AM

    Does this help for starters?
    File[] roots= File.listRoots();
    for (int i= 0; i< roots.length; i++)
         System.out.println(roots[i]+": "+roots.getTotalSpace());kind regards,
    Jos                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get the size of physical memory by using system call ?

    how to get the size of physical memory by using system call ?What system call can be used for me to get the size of physical memor? thanks.

    %vmstat 3
    procs memory page disk faults cpu
    r b w swap free re mf pi po fr de sr s0 -- -- -- in sy cs us sy id
    0 0 0 3025816 994456 4 19 6 0 0 0 0 8 0 0 0 459 253 139 1 1 99
    0 0 0 2864688 777408 0 2 0 0 0 0 0 3 0 0 0 428 134 175 0 1 99
    0 0 0 2864688 777408 0 0 0 0 0 0 0 7 0 0 0 448 112 166 0 0 100
    one interesting observation about vmstat I found out is (mostly on Solaris)
    the first line of information always off chart, so I usually do a few interval to get constant result.
    if you use linux
    just
    cat /proc/meminfo

  • How to get the size of partition?

    The following SQL will get the rows of the fact table & aggregation. But how to get the size (MB) of the partition. select * from $system.discover_partition_stat That should be doable, because in BIDS, we can see the size of a partition, but from which
    view we can do that?

    This is the best bet you have SELECT * FROM SystemRestrictSchema($system.discover_partition_stat ,DATABASE_NAME = 'Adventure Works DW' ,CUBE_NAME = 'Adventure Works' ,MEASURE_GROUP_NAME = 'Internet Sales' ,PARTITION_NAME = 'Internet_Sales_2003') Refer
    this article: http://geekswithblogs.net/darrengosbell/archive/2008/12/02/ssas-are-my-aggregations-processed.aspxvinu

  • How to get the size of the webpage?

    I am designing a program to
    analyse the webpage content.
    wondering how to get the size of
    the webpage including its image's
    size and etc. Thanks in advance.

    As i know , the getContentLength just return
    then number of characters of its HTML code.
    By knowing the length of the HTML code, is
    not possible for me to calculate its download
    time... i wonder is there any way to get the
    total size of the page including its image size,
    applet size, and etc... Thanks : )

  • How to get the size of a hard disk?

    Hi,
    As above, how to get the size of a hard disk by using Java.
    Thanks you!
    Alex

    I would be interested in the answer of this question, too.
    In core Java there is no way to find it out in a platform independent manner because of the hardware abstraction of the VM. So my only idea is to write a native library for doing this and colling it via JNI

  • Let me know how to get screen size of user..

    Hi.
    I'm going to change a container size in a screen, dynamically.
    I want to know that an user's screen is 1024X768 or others..
    Let me know how to get screen size of user's computer.
    Best Regards.
    Kil - Nam.

    Look at Re: SAPgui window size (+)
    Regards

  • How to get more than 256 bytes data

    hello.
    I use Schlumberger 32K Card�iJava Card 2.1�j.
    Please tell me how to get more than 256 bytes data from the applet in the card!!
    According to JCRE specification, need to use Get Response Command.
    What is Get Response command?
    Do I have to write processing of Get Response command to an applet?
    Or JCRE processes Get Response command?
    If knows, please tell me about!!
    Thanks.

    Thanks for your response!!
    I understand that I have to write processing of Get Response command to an applet.
    But case of Schlumberger 32K card, when host send Get Response command to an applet, card reply 6F-00!?
    I'm investigating now, and it seems that response is returned before applet processes Get Response command(CLA = 00, INS = C0).
    Do JCRE perform the process of Get Response command?

  • How to get Folder or document service permissions  by using  KM API's

    Hi,
    Any help how to get Folder or document service permissions  by using  KM API's  
    Any help or hint is greatly appreciated.
    Thanks,
    Costa.

    Hi,
    I have tested it here and it works for me (this code lists the service permissions settings for folder /documents/temp/):
        RID rid = RID.getRID("/documents/temp");
        try {
          IUser user = (IUser) request.getUser().getUser();
          IResourceContext context = new ResourceContext(user);
          IResource res = ResourceFactory.getInstance().getResource(rid, context);
          IResourceFactory resourceFactory = ResourceFactory.getInstance();
          IRepositoryServiceFactory serviceFactory = resourceFactory.getServiceFactory();
          IAclService aclService = (IAclService) serviceFactory.getRepositoryService(res, IWcmConst.ACL_SERVICE);
          IResourceAclManager aclResourceManager = aclService.getAclManager();
          IResourceAcl resourceAcl = aclResourceManager.getAcl(res);
          boolean inheritedAcl = false;
          if (resourceAcl == null) {
            resourceAcl = aclResourceManager.getInheritedAcl(res);
            inheritedAcl = true;
          response.write("<strong>SERVICE PERMISSION OWNERS</strong><br>");
          IUMPrincipalList ownerList = resourceAcl.getOwners();
          IUMPrincipalListIterator ownerListIt = ownerList.iterator();
          while (ownerListIt.hasNext()) {
            IUMPrincipal ownerPrincipal = ownerListIt.next();
            String strPrincipal = ownerPrincipal.getId();
            response.write(strPrincipal + "<br/>");
          response.write("<br><strong>SERVICE PERMISSIONS</strong><br>");
          IResourceAclEntryList el = resourceAcl.getEntries();
          IResourceAclEntryListIterator it = el.iterator();
          while (it.hasNext()) {
            IResourceAclEntry entry = it.next();
            String strEntryPerm = entry.getPermission().getDescription();
            String strPrincipal = entry.getPrincipal().getId();
            response.write("<strong>" + strEntryPerm + "</strong> - principal: " + strPrincipal + "<br/>");
            IAclPermissionList plList = entry.getPermission().getMembers();
            IAclPermissionListIterator plListIterator = plList.iterator();
            while (plListIterator.hasNext()) {
              IAclPermission perm = plListIterator.next();
              response.write(perm.getDescription() + "<br/>");
        } catch (Exception e) {
          response.write(LogWriter.extractCallStack(e));
          LogWriter.traceSevere(LogWrapper.trace, e, LogWriter.extractCallStack(e), true);
    Romano

  • How do I get folder sizes?

    How can I get the finder to calculate folder sizes?
    I've clicked Calculate all sizes in view options.
    Even when I ask for info on a particular folder, I get a blank.
    It gives the sizes of files but never for folders: just two little dashes
    Is this a bug, or is there some extra button I now have to push?

    I believe there's a bug in the Finder that will prevent it from calculating folder sizes. I've only run into it a couple times: for example, Size in the Finder's Inspector window always shows -- (which is normal until the Finder calculates the size). In this case, the Finder doesn't calculate the size, but quitting and relaunching the Finder works to restore proper behavior.

  • How to get the size of a string in bytes

    Morning,
    I’m trying to get the length in bytes of a string, the characters below are 3 byte UTF-8, but when I display
    The length of either int, looks like is double I got 120 and I think it should be 60. Any idea
    String requiredMsg = "όόόόόόόόόόόόόόόόόόόό";
    int byteCountUTF8 = requiredMsg.getBytes("UTF-8").length;
    int byteCountUTF8 = requiredMsg.getBytes().length;
    thanks

    OK, it is not 'o with acute', but rather 'Greek small omicron with tonos'.
    This page may help you sort it out:http://www.fileformat.info/info/unicode/char/3cc/index.htm.
    According to the page and to my tests, this Unicode 03CC has a 2 bytes (not 3) UTF-8 representation.
    String requiredMsg = "\u03CC";
    System.out.println(requiredMsg.getBytes("UTF-16").length);
    System.out.println(requiredMsg.getBytes("UTF-8").length);
    System.out.println(requiredMsg.getBytes().length); // In WindowsResult on my machine:
    4
    2
    1

Maybe you are looking for

  • Submit a job in background

    Hi, We have a query regarding submission of Jobs in background. If we use JOB_OPEN,JOB_CLOSE in our executable program to submit a job to run this proram with a transaction code and also schedule this job in background using SM36 the what will be the

  • Computer is getting a new hard drive and my iPods are full of all my stuff!

    I have a 3rd generation Nano and a 160GB Classic iPod. Here is my problem and I am hoping that someone can tell me how to proceed through this. My computer crashed and is getting a new hard drive installed now. I have all of my music on the Nano and

  • Import Oracle BPA model (EPC) to Oracle BPM 11G

    Hi, I have my business process modeled using Oracle BPA product (EPC format). Now I need to import this model into Oracle BPM 11G which uses BPMN 2.0 format. Does any of the softwares provide a way to transform EPC models to BPMN 2.0 format. These ar

  • Sprite won't respond to custom event

    I've got an app where numerous Sprite objects are being placed on the stage, and then when an event occurs (mouse click most likely) I want all the Sprites to move, independently, based upon an algorithm that each Sprite has.  I can't get the Sprite

  • The display has lines and the color is strange.

    The Retina display has lines and the color is very light when I turn on iPad mini. When I woke up and turned it on this morning, it happened. I have no idea what happened since the iPad mini has been gotten no physical damage.