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 6031995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:16:06+00:00 2026-05-23T05:16:06+00:00

I’m trying to enter a file path into a few .pref files, but instead

  • 0

I’m trying to enter a file path into a few .pref files, but instead of a String, the field wants some sort of Hexadecimal sequence. How can I convert my path into this Hex format?

Mac OS 10.6.7

Here is an example of a file location:

<00000000 009e0003 00010000 c94bbb14 0000482b 00000000 000d3ad2 000dfc12 0000c950 e4db0000 00000920 fffe0000 00000000 0000ffff ffff0001 0008000d 3ad2000c 9ce1000e 000c0005 0069006e 0062006f 0078000f 001a000c 004d0061 00630069 006e0074 006f0073 00680020 00480044 00120015 55736572 732f7263 68617265 7474652f 696e626f 78000013 00012f00 00150002 0010ffff 0000>

  • 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-23T05:16:07+00:00Added an answer on May 23, 2026 at 5:16 am

    It’s alias 'alis' data, which has been the standard way to refer to files in a persistent manner in Mac OS for the last 20 years or more. 😉 The AliasHandle et. al are found in Aliases.h, which is in the CarbonCore.framework of the CoreServices umbrella framework.

    Note that it is Property List Editor (or Xcode) that’s showing you a hexadecimal representation of NSData. The data tells us that you haven’t changed the name of your hard drive (it appears to still be “Macintosh HD”) and that the path of the alias was to /Users/rcharette/inbox

    The “newfangled” name for this is bookmark data, which was introduced in 10.6.

    There are a couple of high-level wrappers around aliases, Nathan Day’s NDAlias, I believe.

    Otherwise, the following is mine, a category on NSString modeled after the new bookmark APIs available in NSURL (which require 10.6). (This code should work on 10.3+):

    MDBookmarks.h:

    #import <Foundation/Foundation.h>
    
    //  Constants
    //  MDBookmarkResolutionWithoutUI
    // Option for specifying that no UI feedback accompany resolution of the bookmark data.
    enum {
        MDBookmarkResolutionDefaultOptions      = 1,
        MDBookmarkResolutionWithoutUI = ( 1UL << 8 )
    };
    typedef NSUInteger MDBookmarkResolutionOptions;
    
    
    @interface NSString (MDBookmarks)
    
    - (NSData *)bookmarkDataWithError:(NSError **)error;
    
    + (id)stringByResolvingBookmarkData:(NSData *)bookmarkData 
                                options:(MDBookmarkResolutionOptions)options
           bookmarkDataIsStale:(BOOL *)isStale error:(NSError **)error;
    
    @end
    

    MDBookmarks.m:

    #import "MDBookmarks.h"
    #import <CoreServices/CoreServices.h>
    #import <sys/syslimits.h>
    
    @implementation NSString (MDBookmarks)
    
    - (NSData *)bookmarkDataWithError:(NSError **)outError {
        if (outError) *outError = nil;
        NSString *path = [[self stringByResolvingSymlinksInPath]
                                   stringByStandardizingPath];
        AliasHandle alias = NULL;
        FSRef itemRef;
        OSStatus status = FSPathMakeRef((const UInt8 *)[path UTF8String], &itemRef, NULL);
        if (status != noErr) {
            if (outError) {
                if (status == fnfErr) *outError = [NSError errorWithDomain:NSCocoaErrorDomain 
                  code:NSFileNoSuchFileError userInfo:nil];
                else *outError = [NSError errorWithDomain:NSOSStatusErrorDomain
                  code:status userInfo:nil];
            }
            return nil;
        }
        status = FSNewAlias(NULL, &itemRef, &alias);
        if (status != noErr ) {
            if (outError)
            *outError = [NSError errorWithDomain:NSOSStatusErrorDomain
                    code:status userInfo:nil];
            return nil;
        }
        HLock((Handle)alias);
        NSData *bookmarkData =
    [[[NSData dataWithBytes:*alias length:GetHandleSize((Handle)alias)] retain] autorelease];
        HUnlock((Handle)alias);
        if (alias) DisposeHandle((Handle)alias);
        return bookmarkData;
    }
    

    —

    + (id)stringByResolvingBookmarkData:(NSData *)bookmarkData
            options:(MDBookmarkResolutionOptions)options
             bookmarkDataIsStale:(BOOL *)isStale error:(NSError **)outError {
        if (bookmarkData == nil) return nil;
        if (outError) *outError = nil;
        AliasHandle alias = NULL;
        FSRef resolvedRef;
        Boolean wasChanged = false;
        OSStatus status = PtrToHand([bookmarkData bytes], (Handle *)&alias,
                                                  [bookmarkData length]);
        if (status) {
            if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain
                             code:status userInfo:nil];
            return nil;
        }
        status = FSResolveAliasWithMountFlags(NULL, alias, &resolvedRef, &wasChanged,
                 (options & MDBookmarkResolutionWithoutUI ? kResolveAliasFileNoUI : 0));
        if (status) {
            if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain
                                code:status userInfo:nil];
            return nil;
        }
        UInt8 thePath[PATH_MAX + 1];
        status = FSRefMakePath(&resolvedRef, thePath, PATH_MAX);
        if (status != noErr) {
            if (outError) *outError = [NSError errorWithDomain:NSOSStatusErrorDomain 
                            code:status userInfo:nil];
            return nil;
        }
        if (isStale) *isStale = wasChanged;
        return [NSString stringWithUTF8String:(const char *)thePath];
    }
    @end
    

    Otherwise, if you can require 10.6, then check out the newer APIs in NSURL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I would like to count the length of a string with PHP. The string

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.