Get exact size of directory or bundle

How can I get exact size of directory or app bundle? The `du` command shows disk usage (as per command name), is there a command to get exact file size in bytes (stripping the overhead bytes of blocks)?

Try the following, which takes into account resource forks:
STARTING_DIR="$HOME/Movies"
find "$STARTING_DIR" -type f |\
    perl -ne '
        chomp $_;
        @st=stat($_);
        $sum+=$st[7];
        @st=stat("$_/rsrc");
        $sum+=$st[7];
        END{print "$sum\n";}
My quick testing seems to indicate that directories and subdirectories are not being counted, but file resource forks are.
My tests did not try Aliases, Symlinks, CHR, BLK, or FIFO typed files, so it may or may not be accurate.

Similar Messages

  • Why TextFrames does not get exactly specified size?

    Hi, I'm experiencing the following problem:
    when I create some TextFrames and specify size using this code below:
    Illustrator.CharacterStyle curStyle = curDok.CharacterStyles.Add("ColorText" + text.Id.ToString());
    charAttr.Size = Convert.ToInt32(text.Size * 2.5F);
    charAttr.TextFont = newFont;
    curTextFrame.Contents ="SOME TEXT";
    curTextFrame.Top = 200;
    curTextFrame.Left = 200;
    curTextFrame.Height = 1000;
    curTextFrame.Width = 2000;
    curStyle.ApplyTo(curTextFrame.TextRange, false);
    I get different TextFrames size, when I save image into some file format(I've tried .eps and pdf). For example, if I specife 2000 width of th frame and create few frames with different text, they all get different sizes, some of them becomes 2300 width, etc. Is this some type of scaling, or what?
    P.S. If you have some code(in any language), that creates TextFrames, and they get exactly specified size, please, post it here. Thank you.

    If you don't need to be able to edit the text here is some code that should work. Worked for me using CS2 and Visual C# 2008.
    Illustrator.Application ai = new Illustrator.Application();
    Illustrator.Document doc = ai.Documents.Add(AiDocumentColorSpace.aiDocumentCMYKColor, 100, 100);
    Illustrator.CharacterStyle curStyle = doc.CharacterStyles.Add("ColorText");
    Illustrator.TextFont textFont = ai.TextFonts["Arial-Black"];
    int textSize = 20;
    curStyle.CharacterAttributes.Size = Convert.ToInt32(textSize);
    curStyle.CharacterAttributes.TextFont = textFont;
    Illustrator.TextFrame curTextFrame = doc.TextFrames.Add();
    curTextFrame.Contents = "SOME TEXT";
    curStyle.ApplyTo(curTextFrame.TextRange, false);
    Illustrator.GroupItem textGroup = curTextFrame.CreateOutline();
    textGroup.Top = 200;
    textGroup.Left = 200;
    textGroup.Height = 1000;
    textGroup.Width = 2000;
    Hope this helps.

  • Copying a shape to an Exact size in PSE

    I'm trying to place photos within a film strip and make each one an exact size to fit. I was told to select the first photo, then hit inverse and select the second photo and hit delete. Instead of it making it the exact size it removes the photo ( second one) from the film strip. Why is that happening??

    Hi Terri,
    With the filmstrip image open,
    open the images of the people you wish to add,
    Cascade so you can see all the images, or minimize them,
    then,
    Select the first person, what you do next depends on if you want the
    person on a transparent background or if you want to include the
    original background,
    if you want the background,
    using the Rectangular Marquee Tool select the area of the image you
    want & Edit, Copy, make the filmstrip image active & Edit Paste.
    Repeat for each person;
    Each person will be on their own Layer of the filmstrip image so you
    can shrink or stretch them to fit. It will be easier to get the look
    of the people being on the filmstrip if you move the Background image
    to the top of the Layer stack.
    > When I do that her pic disappears.
    Because you need to Select, Inverse, Delete for each image before
    selecting the next image.
    Alex,

  • Can I resize to an exact size in Bridge when exporting with the export panel?

    I need to create and export jpegs to an exact size: 5700 pixels lonmgest side. I used to do this using the 'fit image' command in photoshop. However, if I enter 5700 into the export panel box it converts to just below it, as it's a 'fit to' box.
    Any ideas? as i'm testing. If this is possible without photoshop then we will be able to encorperate bridge CS5 into our company workflow. Thank you

    You do get rounding errors in Bridge this is normally 1 pixel less, so this needs to be fixed by the Bridge team.
    There are no other parameters..  bitmapDataObj.resize(dimension[, quality])

  • Exporting exact size image file

    CS3/4
    Can anyone tell me now to go about setting things up so that if I export my work to an image format like *.psd... I can predetermine the exact size the image will be?
    I've groped around in the help file but this kind of thing is hard to nail down the search strings that will unearth something.  So far I haven't.
    That goes ditto for google too.  Seems like there are too many things matching the needed key words.
    I see 2 things in the export dialog itself which probably has bearing on final size.  Those are the check box of whether to include artboard or not and more important the resolution to save at.
    But still seems no way to know in advance what it will be.
    I have found that if I stay with screen resolution (72) then the final output will be very close to the same size as the artwork itself.  Just with in
    rounding of decimals in fact.
    So is there some nifty formula to get the exact size a 150 or 300 Resloution image will be?

    it sounds like youre perhaps misunderstanding the relationship of size and resolution.  72 is screen or web resolution which is why it "looks" the same.
    if exporting from AI to psd, use the Image>Image Size option in photoshop.
    •  if you are using for web then use the "Save For Web & Devices" feature under "File". You get a lot of options on file type and size.
         Uncheck "Clip to Artboard" if you only want to export the visible images.
         If you are using masks, you may want to use the crop tool to select exactly what you want to export, and then you can set exact sizes in the "Image Size" tab. Dont forget to constrain proportions.
    •  if you want to print a file then the size is "set" at the size you dictate in the "image size" and the resolution affects how good it looks when it prints out.
    HTH

  • How to print an exact size in illustrator

    I have reproduced a very detailed map that I now want to print. The original was based on a scanned version that measures in PS 36 X 45 inches or 10440 X 13920 px. I want one copy to be at the larger size and it does not need to be exact. I want a second print to exactly match the original at 15.92 inches wide. I don't see how to get this exact size print in AI and since I will be taking this to an outside printer I thought it would be nice if I knew how to get this exact size print.

    Richard,
    Your description of what you have done and your requirements are not clear. All the responses thus far involve some degree of guessing.
    I have reproduced a very detailed map that I now want to print.
    What do you mean by "reproduced"? Traced it as vector paths in Illustrator? Reworked it in Photoshop?...?...?
    The original was based on a scanned version that measures in PS 36 X 45 inches or 10440 X 13920 px.
    Okay. You have a 10440 x 13920 pixel raster image.
    Those proportions do not scale to 36 x 45 inches.
    They scale to 33.75 x 45 or 36 x 48.
    I want one copy to be at the larger size and it does not need to be exact.
    What "larger size"?
    What do you mean by "a copy"? How is this going to be printed? Offset lithography? One-off large format inkjet printer?...?
    Assuming we're talking about offset, sheetfed, CMYK printing the raster image combined with some native Illusrator artwork, do this:
    1. Open the image in Photoshop. Perform whatever raster retouching you want. Perform whatever color correction you want. When all rework of the image itself is done, be sure you end up in CMYK mode. Save the file in Photoshop format as "Original".
    2. ReSIZE it to the desired print scale. Crop it to the area you want to print, plus at least .125" extra on any side that bleeds. ReSAMPLE it to 1-to-2 times the halftone screen ruling that will be used when it is printed. Flatten layers. Remove any extra channels. Sharpen it appropriately. Save in TIFF format, as "LargeMap".
    3. Set up a new Illustrator document an appropriate size. "Appropriate size" depends upon the printing setup and whether there are bleeds. You can set the Artboard size to the size of the press sheet (assuming sheetfed printing), or to the trim size plus any bleed, plus room for any trim or fold marks you want to include.
    4. Import the raster image. Position it correctly relative to the trim marks or guides. Put it on its own layer and lock the layter.
    5. Draw the native Illustrator stuff on Layer(s) above it.
    6. Save as Press Ready PDF.
    I want a second print to exactly match the original at 15.92 inches wide.
    For best results, open the cleaned up, full-res image you saved and named as "Original" in step 1. Then repeat steps 2 (saving it as "SmallMap") through 6.
    I don't see how to get this exact size print in AI
    You can scale a raster image that you have placed in Illustrator, just as you would scale any other object. For example, assuming the image you place is the original 10440 x 13920 scan. You could simply turn on the proportional link in the Transform palette, and set the width to, say 15.92 inches. But that would scale the image to a grossly oversampled 656 ppi.The excess data would simply get averaged away in the imaging process, resulting in a slight blurring and "muddying" of the image. (In other words, it would effectively undo your careful sharpening.)
    and since I will be taking this to an outside printer I thought it would be nice if I knew how to get this exact size print.
    Raster images should be sampled so as to achieve a ppi that is appropriate to the specific printing method, when scaled to the printed size. Too many people just offhandedly say to "make everything 300 ppi". That is just a corruption of the general rule-of-thumb mentioned above in step 2: Sample your images so that their effective ppi is 1-to-2 times the halftone ruling.
    Assuming the common 150 lpi halftone, 225 ppi would be considered dead center of that range, not 300 ppi. 150 ppi is the "low side" of the range; 300 is the "high side". When a range is given, you don't just automatically set everything at the "high side"; otherwise, there would be no reason for providing a range. (If your tires say the maximum inflation is 45 psi, is that the pressure you always use?).
    The "high side" is not necessarily for "best results"; it's to allow some fudge room convenience if you decide to scale the image larger on page. Neither is the "low side" necessarily "worst results" or "borderline results": It depends on the image. For example, there is no reason to set a soft-edged drop shadow at higher than the halftone ruling. There is no sharp detail to worry about preserving; the only concern is to avoid visible pixelation, which will not occur if sampled to the halftone ruling. (One round halftone dot cannot render the square shape of a single pixel.)
    JET

  • Opening SWF to its exact size in HTML (ASP page)

    Hi,
    I have one popup window to open any SWF. User clicks a button
    from some other page and the file name is passed to this popup
    window through parameter. The popup window itself is sized at 100%
    to accomodate with any SWF file.
    For the SWF object, if width and height parameters are
    missing, the animation has a default size, if width and height are
    specified at 100%, the animation is resized much bigger...
    Is it possible to find the exact size of the SWF (either by
    VBScript or Javascript) and to resize the control to its original
    size, either using VB variables when the page is built or with
    Javascript once the page is loaded ?
    Many thanks for your help
    Jean-Pierre

    I found the solution.
    Many thanks for your help
    Jean-Pierre

  • How do I get info from Active Directory and use it in my web-applications?

    I borrowed a nice piece of code for JNDI hits against Active Directory from this website: http://www.sbfsbo.com/mike/JndiTutorial/
    I have altered it and am trying to use it to retrieve info from our Active Directory Server.
    I altered it to point to my domain, and I want to retrieve a person's full name(CN), e-mail address and their work location.
    I've looked at lots of examples, I've tried lots of things, but I'm really missing something. I'm new to Java, new to JNDI, new to LDAP, new to AD and new to Tomcat. Any help would be so appreciated.
    Thanks,
    To show you the code, and the error message, I've changed the actual names I used for connection.
    What am I not coding right? I get an error message like this:
    javax.naming.NameNotFoundException[LDAP error code 32 - 0000208D: nameErr DSID:03101c9 problem 2001 (no Object), data 0,best match of DC=mycomp, DC=isd, remaining name dc=mycomp, dc=isd
    [code]
    import java.util.Hashtable;
    import java.util.Enumeration;
    import javax.naming.*;
    import javax.naming.directory.*;
    public class JNDISearch2 {
    // initial context implementation
    public static String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory";
    public static String MY_HOST = "ldap://99.999.9.9:389/dc=mycomp,dc=isd";
    public static String MGR_DN = "CN=connectionID,OU=CO,dc=mycomp,dc=isd";
    public static String MGR_PW = "connectionPassword";
    public static String MY_SEARCHBASE = "dc=mycomp,dc=isd";
    public static String MY_FILTER =
    "(&(objectClass=user)(sAMAccountName=usersignonname))";
    // Specify which attributes we are looking for
    public static String MY_ATTRS[] =
    { "cn", "telephoneNumber", "postalAddress", "mail" };
    public static void main(String args[]) {
    try { //----------------------------------------------------------        
    // Binding
    // Hashtable for environmental information
    Hashtable env = new Hashtable();
    // Specify which class to use for our JNDI Provider
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    // Specify the host and port to use for directory service
    env.put(Context.PROVIDER_URL, MY_HOST);
    // Security Information
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, MGR_DN);
    env.put(Context.SECURITY_CREDENTIALS, MGR_PW);
    // Get a reference toa directory context
    DirContext ctx = new InitialDirContext(env);
    // Begin search
    // Specify the scope of the search
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    // Perform the actual search
    // We give it a searchbase, a filter and the constraints
    // containing the scope of the search
    NamingEnumeration results = ctx.search(MY_SEARCHBASE, MY_FILTER, constraints);
    // Now step through the search results
    while (results != null && results.hasMore()) {
    SearchResult sr = (SearchResult) results.next();
    String dn = sr.getName() + ", " + MY_SEARCHBASE;
    System.out.println("Distinguished Name is " + dn);
    // Code for displaying attribute list
    Attributes ar = ctx.getAttributes(dn, MY_ATTRS);
    if (ar == null)
    // Has no attributes
    System.out.println("Entry " + dn);
    System.out.println(" has none of the specified attributes\n");
    else // Has some attributes
    // Determine the attributes in this record.
    for (int i = 0; i < MY_ATTRS.length; i++) {
    Attribute attr = ar.get(MY_ATTRS);
    if (attr != null) {
    System.out.println(MY_ATTRS[i] + ":");
    // Gather all values for the specified attribute.
    for (Enumeration vals = attr.getAll(); vals.hasMoreElements();) {
    System.out.println("\t" + vals.nextElement());
    // System.out.println ("\n");
    // End search
    } // end try
    catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
    My JNDIRealm in Tomcat which actually does the initial authentication looks like this:(again, for security purposes, I've changed the access names and passwords, etc.)
    <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
    connectionURL="ldap://99.999.9.9:389"
    connectionName="CN=connectionId,OU=CO,dc=mycomp,dc=isd"
    connectionPassword="connectionPassword"
    referrals="follow"
    userBase="dc=mycomp,dc=isd"
    userSearch="(&(sAMAccountName={0})(objectClass=user))"
    userSubtree="true"
    roleBase="dc=mycomp, dc=isd"
    roleSearch="(uniqueMember={0})"
    rolename="cn"
    />
    I'd be so grateful for any help.
    Any suggestions about using the data from Active directory in web-application.
    Thanks.
    R.Vaughn

    By this time you probably have already solved this, but I think the problem is that the Search Base is relative to the attachment point specified with the PROVIDER_URL. Since you already specified "DC=mycomp,DC=isd" in that location, you merely want to set the search base to "". The error message is trying to tell you that it could only find half of the "DC=mycomp, DC=isd, DC=mycomp, DC=isd" that you specified for the search base.
    Hope that helps someone.
    Ken Gartner
    Quadrasis, Inc (We Unify Security, www -dot- quadrasis -dot- com)

  • How can I get the size of a file with apple script

    I try to get the size of a file within an apple script. But I did not find information how to do this.

    There are two ways. I think Apple is moving toward using System Events, which is listed first.tell application "Finder"
    set myFile to selection as alias
    --this just gets a file for me to work with
    --coercing it into an alias is required for the other functions
    end tell
    tell application "System Events"
    get size of myFile
    end tell
    set myInfo to (info for myFile)
    get size of myInfo

  • Getting the size from a model

    Hello
    How can I get the size of a model (from a *.w3d-file). The
    model does not contain the properties width, height or length, so I
    guess that I have to measure the distance between the models
    vertices.
    But I can't seem to think of a good way to do it in. I guess
    a loop of some kind? But it would seem rather unomptimized to
    actually loop through each and every vertex point in the model I
    wan't measured.
    Any suggestions?

    The closest thing to model's dimensional properties is the
    model's boundingSphere property. It gives a radius of an imaginary
    sphere that contains all the vertices of the model; the sphere's
    diameter is the distance between the two farthest-apart vertices.
    However it includes the model's children in the sphere. Set
    yourModel.debug = TRUE to see it.
    You could loop through each model, add a mesh deform
    modifier, go through each mesh[ ].vertexlist, keep track of each
    max and min x, y, and z value, the calculate w, l, h from that. It
    would take a little time... you probably wouldn't want to do it
    every frame. But you could do it on a keypress or something.

  • By mistake, I shrink the size of a particular page, which firefox then remembers. How do I get the size back to normal?

    When moving around on websites, somehow I manage to shrink the size of what is shown on the screen. I have not figured out how to get the size back to 'normal'. However, Firefox remembers this so when I reenter this particular size, it will still be in the smaller format. Very frustrating and as this has happened for at least two of my most watched sites, I am more and more using competing formats, e.g. Explorer.
    I have alsl asked more experienced users of Internet to try to solve this but they are as lost as I am.
    Looking forward to getting your advice.
    Best regards,
    Lars Henriksson

    You can hit CTRL++ to zoom. Or install these add-ons:
    https://addons.mozilla.org/en-US/firefox/addon/theme-font-size-changer/
    https://addons.mozilla.org/en-US/firefox/addon/zoom-page/

  • 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 do I get the size of a file on a server with an Applet

    Hei,
    I have a problem. I have some files that I need to read in with InputStream to get an Array of bytes. The Applet and the files are on the same server.
    My Prob is, that when I use
    URL(daFile).getFile().getSize();
    it only gives the inaccurate size from the dirlisting (i.e. 48 for 48k)
    So I can not build an array with the correct Size.
    Does anyone knows how I get the correct size of a file.
    Big thx
    LoCal

    Appler can open connections to server it was downloaded from. You don't need such complicated API as RMI... Just simple java server listening for queries.
    Like this:
    Applet:
    1. take a file path
    2. connect to simple server (gives OutputStream and InputStream)
    3. create ObjectOutputStream and send fiel to server (File is serializable)
    4. Read String with size from input stream
    Server
    1. Wait for connection
    2. When client connected create ObjectInputStream and expect File instance
    3. Get file size
    4 Replay with String with size
    Like this...

  • How to get the size of the cuurrent illustration

    Sorry, I made a mistake before this one. The questios is this: can anybody tell me how can I get the size of the current illustration, (as oposed to the page size) in points. Something like 120 points wide and 87 points High?. What function do I need to call?

    From AI Function reference (included with CS2 SDK):
    AIDocumentSetup setup;
    error = sDocument->GetDocumentSetup(&setup);
    if (error) goto processError;
    writeDocumentSetup( &setup );
    The AIDocumentSetup record returns the following information:
    typedef struct {
    AIReal width, height;
    AIBoolean showPlacedImages;
    short pageView;
    AIReal outputResolution;
    AIBoolean splitLongPaths;
    AIBoolean useDefaultScreen;
    AIBoolean compatibleGradients;
    AIBoolean printTiles;
    AIBoolean tileFullPages;
    } AIDocumentSetup;

  • 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                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • TypeError: Error #1009 on FLVPlayback

    I've been struggling with this error for a few days now, I can't seem to figure out what is actually going wrong. TypeError: Error #1009: Cannot access a property or method of a null object reference.      at fl.video::UIManager/http://www.adobe.com/

  • Translucent Menu Bar never was and still is not an option

    When I first got Leopard one of the the first things I noticed was my menu bar wasn't translucent. I have an HP w2007. I just installed 10.5.2. I was told it would have an option to turn it on or off. It doesn't. I went to desktop and screensaver pre

  • No SQL data sources EAS 11.1.1.3 W2K3R2

    Hi all, I can't get an "SQL data sources" load for creating my rule files. I'm using WS 2003R2 64 bit, Oracle Hyperion entreprise performance management system, hyperion entreprise performance management system foundation, essbase client and server 1

  • Access W2 form from ESS

    Hi All, My requirement is to give the employees the ability to view their w2 form from ESS. Is it possible in EHP3? Thanks Harish

  • Automatically highlight the next message and remove the "unread" status

    In my inbox on Ipad, when I  swipe and delete a  message or highlight the message and hit the delete icon in the upper right corner, it will automatically highlight the next message and remove the "unread" bullet next to the message. This is version