Get folder size

I am trying to get the size of a folder I used:
Set Archive to "Martha:EyeTV Archive"
Set ASize to size of (info for Archive)
I get and error on "info for Archive" saying it can find the file. This is a folder not a file. Do I have to use a shell script:
Set ASize to word 1 of (do shell script "/usr/bin/du -ks" & quoted form of (POSIX path of (Archive as string)))

By the way, since the Standard Additions scripting dictionary describes the “info for” command as deprecated, maybe you'd better use the following code:
set Archive to POSIX file "/Volumes/Martha/EyeTV Archive" as alias
tell application "System Events" to set ASize to size of Archive
You could also ask for the “physical size” property of the Archive folder.

Similar Messages

  • 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

  • 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.

  • Get folder size error 800A004C

    I am trying to make a script Counts the size of a folder.
    I am getting a vbs error "Path not found" 800A004C on line 19 (Q = Q + F.size)
    dim oFS, oFolder
    set oFS = WScript.CreateObject("Scripting.FileSystemObject")
    set oFolder = oFS.GetFolder("E:\NEW-backup\")
    set qFS = WScript.CreateObject("Scripting.FileSystemObject")
    set logFolder = qFS.GetFolder("E:\Backup Logs\")
    ShowFolderDetails oFolder
    sub ShowFolderDetails(oF)
    dim F
    dim Q
    dim antalGB
    dim attachment
    dim subject
    Q=0
    for each F in oF.Subfolders
    Q = Q + F.Size
    Next
    antalGB = "Dagens backup fylder: " + FormatNumber(((Q/1024)/1024)/1024, 2) + " GB" + "\n\nMvh\n"
    If I run the script on E:\Backup instead of E:\NEW-backup I get no errors.
    Please help I am a noob to scripting

    If you can try in PowerShell - the below sample code may help you - THis returns folder size in MB
    function Get-FolderSize
    param ( [String]$Path )
    $FileSystemObject = New-Object -com Scripting.FileSystemObject
    $folders = (Get-Childitem $path | ? {$_.Attributes -eq "Directory"})
    foreach ($folder in $folders)
    $folder | Add-Member -MemberType NoteProperty -Name "SizeMB" –Value(($FileSystemObject.GetFolder($folder.FullName).Size) / 1MB)
    $folders | sort -Property SizeMB -Descending | select fullname,@{n=’Size MB’;e={"{0:N2}" –f $_.SizeMB}}
    Get-FolderSize -Path C:\Temp\
    You may get some insight / help for your code as well!
    Regards Chen V [MCTS SharePoint 2010]

  • File / Folder size... How do Finder gets it?

    Hi there!
    While checking some of my hardrives for sucessfull shell script execution backups, i noticed that Finder took a loooot of time to provide the info about the Folder / File size on the Information window, while a simple ls -l could provide on the fly values regarding file or folder size, as always, fast simple and faithfull unix mindset!
    Well, that makes me wonder, how does Finder calculates those values? Anyone got an hint?
    Does it make it all by himself, if so. WHY? Been an "posix" system, shouldn't he be using whats already provided by its *nix heritage?
    In this case, the value is already there, why don't use it and simply parse it to the desired format (MB / GB / TB)?
    Maybe this could be only one of several features (GUI) that could improve it's performance from being more "conscious" of the system natively provided "toolkit".
    Please, this is only my humble thouhgts on this, and please do shut me up if totally wrong!
    Hope to get some nice and interesting feedback from the OS X community!
    If there's a better spot to start this kind of discussion, please do mention it, i will appreciate it!
    Best regards.

    Properties. Short Cuts, Change Icon resolved the issue after restarting. Problem resolved.. Thank you for all the help Dwain

  • How to get the personal folder size

    Hi,
    I'm trying to develop a method for define the maximum size of personal documents folder. I'm changing the Upload Command, and I want to know if its possible to get the current size of the personal documents folder for the user that is trying to upload the document.
    For this moment, I've got the current UserID, and I have created an RID with the path "userhome/UserID/Personal Documents", but now I don't know how to get the size of this folder!!!!
    Thanks to all.
    Arnau Rovira

    Originally Posted by NanLau
    Hi,
    Does anyone know how to get the current size of Mailbox and Archive by using GW api?
    Can anyone answer this? Thanks.

  • How can I get Finder to recalculate folder sizes?

    How can I get the Finder to recalculate folder sizes?
    I had a folder called "architecture 600," with lots of large files in it; when I checked it with command-i, the Finder told me it contained 691 MB of information.
    I then moved most of the files to another folder (not just to the desktop, but to a new folder in the Documents folder). However, when I select "architecture 600" and press command-i, Finder still tells me it's 691 MB. When I open up "architecture 600," there are only three items in it, which total 305 MB.
    I've tried removing and re-adding the size column in the enclosing folder, and turning off and then back on the "calculate all sizes" checkbox in the view options (command-j) for the enclosing folder. The finder still gets the size of the folder wrong.
    This is happening with lots of folders, not just "architecture 600," by the way.

    This has been a bug since OS X 10.0. As far as I know, the only way to get Finder to accurately reflect the size of a folder after moving data out of it is to add another folder (or file) to it, even an empty folder will trigger the Finder to recalculate the folder's size.

  • Get the each folder size in ASM

    Hi,
    i have a ASM disk group name as DATA. which contains 30 folders. under 30 folders they are so many folder. if my present directory is DATA and i want to see the size of each folder and sub-folders also . what is command to see the size of each folder in ASM? I used du command, but it shows only total size of all 30 folders. i want each folder size. please let me know the command.

    Zstar Electronic Co.Ltd, Wholesaler of fire cards for DS/NDSL/NDSi, Provide R4, R4i, DStt, iEDGE, AK2i,M3,M3i,N5
    www.zstar.hk

  • Where would i get Batch Size in SAP BI and what is the cocept of Batch Size

    <heading 4>
    Dear Experts,
                  I have to create a report on batch size adherence i.e. Actual Vs. Standard Batch Size Deviation,but i am unable to find batch size in sap R/3 AFKO & APPO tables and was unable to find it in material master too.
         Please suggest me what is the concept of batch size?where can i get batch size in sap R/3? and in what cube there are chnaces that i will get it on Bi side.
    Regards,
    Beginer
    </heading 4>

    Hi,
    The dswsbobje web application (war file) is mentioned in SAP IK XI 3.1 install guide to explain how to get the SAP authentication option available in Business Objects products such as Live Office, which use web services to log on to BusinessObjects Enterprise.
    The source files for various Business Objects web applications are available in "businessobjects_root\BusinessObjects Enterprise 12.0\java\applications\" folder. Refer to "Deploying the web applications using wdeploy" section in SAP IK XI 3.1 install guide to see how to repackage those web apps and deploy them using wdeploy tool.
    Regards,
    Boris

  • How to get the size of the file

    Hi All,
    I want to get the size of the file in terms of bytes. I used the following code it returns the value in long how can get it in bytes
    import java.io.File;
    public class ServerBackupCheck {
         public static void main(String args[]){
              File f = new File("C:/Program Files/Apache Software Foundation/Tomcat 5.5");
              System.out.println(f.isDirectory());
              System.out.println(f.getTotalSpace());
    output:
    true
    20964163584
    regards,
    Maheshwaran Devaraj

    if it is a folder you can use this recursive algorithm
    public static long recurse(File f) throws IOException
              long bytes = 0;
              File files[] = f.listFiles();
              for(int i =0 ;i<files.length;i++)
                   File file = files ;
                   if(file.isFile())
                        FileInputStream fis = new FileInputStream(file);
                        byte[] by = new byte[fis.available()];
                        fis.read(by);
                        bytes = bytes + by.length;
                   if(file.isDirectory())
                        bytes = bytes + recurse(file);
              return bytes;
    System.out.println(recurse(f));  gives you the total bytes....
    Ayberk Cansever ..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Finder won't display folder size in "Size" column or Info window

    Normally, the Finder window will display a folder's size in the Size column. However, I have one folder which shows as "Zero KB" in the Size column. When I open the General Info window, the Size reads as "Zero KB on disk (Zero bytes) for 0 items."
    In order to get the folder size I have to go into the folder, select all folders (there's many), then with either the Summary Info or Inspector window, it'll show the folder size ("185.32 GB on disk").
    Why is this occurring in only this folder? Is it because it's a large folder or a folder with many subfolders?
    I'm running Snow Lep 10.6.2. The folder is on an external drive in FAT32 format. I've already tried deleting the "com.apple.finder.plist" file and rebooting.
    Thanks for any help.

    go to view menu->show view options and check the box 'calculate all sizes". then click "use as defaults".

  • Finder Folder Size Calculations

    When I'm archiving, I have to do a lot of Get Info to calculate the folder sizes for DVD burning. Problem I'm having is the file size calculations start taking forever after working for a few minutes, or they don't calculate at all. Usually works fine when I start but after a minute or so It's like the computer get's tired and just stops. Even if it's a 1mb folder it will have trouble.
    Is this normal? Seems really odd that something so incredibly simple can make my archiving process so difficult.
    Files reside on a network HD.
    Thanks for any help.

    I'd create a disk image of appropriate size, mount it, copy items to it until it tells you there's no more room. Then, burn it.

  • Why does Time Machine folder sizes exceed physical capacity?

    I have a MAC G3 Server Serving multiple MACs as a Storage, Media Server, and Time Machine storage. These other external MACs are all running Version 10.8.3. Only the Storage server is running 10.5.8.
    All of the extenal Macs use Time Machine to backup to the served Storage media volume called "Time Machine".
    The physical size of the "Time Machine" volume is 2.0 TB.
    Yet when I am on the G3 Server, and perform a "Get Info" on the "Time Machine" volume, and also the folder that contains the Server's backups, the stored capacities exceed the physical capacity of the drive to which the volume resides.
    The single physical drive is 2.0 GB and only has one partition called "Time Machine". In the root directory of this volume there is the one folder called Backups.backupdb, and a .sparsebundle DMG file for each of the remote systems that are bing backed up by Time Machine.
    Each of the sparsebundles are well below the dirve's physical capacity, but both the local server's backup folder (Backups.backupdb) and the G3 server's local volume "Time Machine" show a used capcity that well exceeds the physical capacity of the drive on which it resides.
    For example, here is the information from "Get Info" on the Backups.backupdb folder on the "Time Machine" volume when viewed from all systems:
    Kind: Folder
    Size: 3,456,930,478,415 bytes (3.46 TB on disk) for 122,254 items
    But the Physical Volume "Get Info" shows this:
    Kind: Volume
    Capacity: 2.0 TB
    Available: 169.92 GB
    Used: 3,456,930,478,415 bytes (3.46 TB on disk) for 122,254 items
    (NOTE: this is identical to the size
    My guess is that there is some sort of deduplication involved.
    If so, I would like to know the type of deduplication is performed?
    Is it File Level deduplication, Block Level, or Content Level?
    Also, is the deduplication inhererant on the volume (File System) level, or only specifically for Time Machine, via symbolic links?
    Thank you in advance.
    Jeff Cameron

    This is due to the way Time Machine stores files. While there is only one copy of each version of each file stored, there are multple links to that file, and each link is reported in Get Info at its restored size.
    How Time Machine Works its Magic

  • Get folder name for item

    Hi All,
    I need to retrieve the folder name for where the item is stored to generate a report in following format in csv
    File Name Full Path Parent Folder Created By Last Modified By Number of Versions Total Size
    My code which gets all other info.
    function Get-DocInventory() {
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $site=Get-SPSite -Identity "siteURL"
    foreach ($web in $site.AllWebs) {
    foreach ($list in $web.Lists) {
    if ($list.BaseType -ne "DocumentLibrary") {continue}
    foreach ($item in $list.Items) {
    $data = @{
    # "Web Application" = $webApp.ToString();
    #"Web" = $web.Url
    "Site" = $site.Url
    "list" = $list.Title
    "Item ID" = $item.ID
    "Item URL" = $site.Url+"/"+$item.Url
    "Item Name"= $item.File.Name
    “Item Versions” = $item.Versions.Count
    "Item Created" = $item["Created"]
    "Extensions" = $item.name.split(".")[1]
    "Item Modified" = $item["Modified"]
    "Item Created By" = $item["Author"]
    "Last Updated by" = $item["Editor"]
    "File Size" = $item.File.Length/1KB
    New-Object PSObject -Property $data
    $web.Dispose();
    $site.Dispose()
    #Get-DocInventory | Out-GridView
    Get-DocInventory | Export-Csv -NoTypeInformation -Path D:\Scripts\Hemant\inventory.csv
    Coukld you please help me get folder name
    Thanks Basva

    To get the full Folder URL you could use:
    $item.File.ParentFolder.Url
    And just for the Folder Name use:
    $item.File.ParentFolder.Name

  • Folder size indication

    It would be helpful when in folder view to be able to see the size of the folder - I fill folders until they are a DVD-worth and then archive and create a new folder (DAM approach). Currently I have to go to windows to see the size and then back to Bridge to decide what to do next.
    A folder size indication when folder on Content panel + perhaps a right click to give properties etc. as per Windows.

    This is about as minimal as Finder lets it get -
    As far as I can tell that arrangement is displayed only when viewing the Desktop.
    Finder uses a slightly longer one for a window whose view is set to Icon -
    ...and the one I posted previously for windows whose view is set to List.
    In Finder, there is actually only one View Options display and it is live; what is shown in it will change as you change the view mode for a window, and also will change to reflect the choices/settings if you click on a different window.
    Perhaps Path Finder has altered how that behaves. However, try some experimenting. Open the View Options display, and then try navigating into a nest of folders. Try highlighting different things in the Path Finder displays - the name of a folder in a list, the name of a column display, etc. At some point you may be able to access the long form for the particular folder's window.
    On the other hand, Path Finder seems to act by changing how Finder's info is displayed. In doing so, it may also be interfereing with Finder's ability to present applicable choices in the View Options screen (perhaps because Finder is not coded to understand Path Finder). If you determine that is indeed the case, suggest you send a 'bug' report back to the publisher, explaining the problem and asking them to fix it in a future release of Path Finder.

Maybe you are looking for

  • Report server is not working in version 10.1.2....

    Hi all From long time i am trying to run the report server in Forms [32 Bit] Version 10.1.2.0.2 (Production) without Network( IP) configuration.But i did not do it.But its working fine with IP address.Is it possible to run report server without IP ad

  • Place multiple text files

    I don't know if anyone else has experienced this, but often, when I want to place multiple Word files, it places the same text. Even just now, I changed my preferences to link to the files so I can see the name of the file I was placing in the Links

  • Adobe 10.1 Windows Explorer won't cooperate

    Attempting to submit an application that requires 9.0 or higher Adobe. I installed 10.1. Now, when I attempt to submit the application, Windows says "stopped working..."...application not send

  • Embedding an Image as a template in mail - is it possible?

    Hi, I know that if I am sending an attachment to another mac person who uses mail, that the image will appear "inline" (in the main body of the text). What I want to know is whether it is possible to embed an image as a template or background in mail

  • Redirecting podcast episodes in iWeb '08

    Hi, I have put off upgrading to iWeb '08 due to the problem with it changing the podcast feed. Has anyone actually solved the problem and got it to change without losing subscribers? I have over 3,500+ subscribers and can't risk losing them. I have s