Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 542533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:27:24+00:00 2026-05-13T10:27:24+00:00

through terminal you can make it with a command – SetFile -a B filename

  • 0

through terminal you can make it with a command – “SetFile -a B filename”

programmatically i think i should set one of the attributes through
[[NSFileManager defaultManager] createDirectoryAtPath:dirPath withIntermediateDirectories:NO attributes:attributes error:nil];

but i can’t find which one.

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:27:25+00:00Added an answer on May 13, 2026 at 10:27 am

    It is still useful to be able to set the bundle bit programmatically, for instance iPhoto does this to make the iPhoto Library folder appear as a single file.

    You can set the bundle bit programmatically using the Carbon File Manager API. You’ll need to make sure your app links against the Carbon framework and import the <Carbon/Carbon.h> header. These calls are 64-bit safe.

    - (void)setBundleBitOfFile:(NSString*)path toBool:(BOOL)newValue
    {
        const char* pathFSR = [path fileSystemRepresentation];
        FSRef ref;
        OSStatus err        = FSPathMakeRef((const UInt8*)pathFSR, &ref, /*isDirectory*/ NULL);
    
        if (err == noErr)
        {
            struct FSCatalogInfo catInfo;
            union FinderInfoTransmuter finderInfoPointers = { .bytes = catInfo.finderInfo };
    
            err = FSGetCatalogInfo(&ref,
                                   kFSCatInfoFinderInfo,
                                   &catInfo,
                                   /*outName*/ NULL,
                                   /*FSSpec*/ NULL,
                                   /*parentRef*/ NULL);
    
            if (err == noErr)
            {
                if (newValue)
                    finderInfoPointers.finderInfo->finderFlags |=  kHasBundle;
                else
                    finderInfoPointers.finderInfo->finderFlags &= ~kHasBundle;
    
                FSSetCatalogInfo(&ref,
                                 kFSCatInfoFinderInfo,
                                 &catInfo);
            }
        }
    }
    
    - (BOOL)bundleBitOfFile:(NSString*)path
    {
        BOOL value          = NO;
    
        const char* pathFSR = [path fileSystemRepresentation];
        FSRef ref;
        OSStatus err        = FSPathMakeRef((const UInt8*)pathFSR, &ref, /*isDirectory*/ NULL);
    
        if (err == noErr)
        {
            struct FSCatalogInfo catInfo;
            union FinderInfoTransmuter finderInfoPointers = { .bytes = catInfo.finderInfo };
    
            err = FSGetCatalogInfo(&ref,
                                   kFSCatInfoFinderInfo,
                                   &catInfo,
                                   /*outName*/ NULL,
                                   /*FSSpec*/ NULL,
                                   /*parentRef*/ NULL);
    
            if (err == noErr)
            {
                value = (BOOL)(((finderInfoPointers.finderInfo->finderFlags) & kHasBundle) == kHasBundle);
            }
        }
    
        return value;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I make a python script that is run only through terminal (no
Here is my question, when interacting with Sqlite 3 through terminal, you can execute
I can log in to mysql through Terminal using mysql -u root -p I'm
i am currently trying to run a web crawler through the terminal. it compiles
Through a bit of digging, I've discovered how to set and get the volume
Through JavaScript I am appending one query parameter to the page url and I
EDIT: For anyone coming to this question through searching, you can install a Gnome
I have nagios alerts set up to come through jabber with an http link
Is it possible to open the command prompt (and I guess any other terminal
When I run the Scheme interpreter in my terminal [Ubuntu 10.04], I can't seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.