• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: coremidi & codewarrior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coremidi & codewarrior


  • Subject: Re: coremidi & codewarrior
  • From: "Jeremy@Verizon" <email@hidden>
  • Date: Thu, 21 Feb 2002 22:05:35 -0500

Thank you Laurent. Here is a solution for anyone else who runs into this
conversion problem. Note the solution below limits path names to 255
characters so it is NOT a complete solution. Also it uses c2Pstr which it
seems Apple is not encouraging.

void ConvertPathToUnixStyleMachOPath(StringPtr s)
{
CFStringRef path =
CFStringCreateWithPascalString(kCFAllocatorDefault, s,
CFStringGetSystemEncoding());
CFURLRef theURL =
CFURLCreateWithFileSystemPath(kCFAllocatorDefault,path,
kCFURLHFSPathStyle, false);
CFIndex bufLen = sizeof(Str255) - 1;
if (CFURLGetFileSystemRepresentation(theURL, true, s, bufLen))
c2pstr((char *)s);
CFAllocatorDeallocate(kCFAllocatorDefault, (void *)theURL);
CFAllocatorDeallocate(kCFAllocatorDefault, (void *)path);
}

Jeremy

> From: Laurent Cerveau <email@hidden>
> Date: Thu, 21 Feb 2002 11:49:16 +0100
> To: "Jeremy@Verizon" <email@hidden>
> Cc: email@hidden
> Subject: Re: coremidi & codewarrior
>
> In order to manipulate references to file in OS X, CFURL is your
> friend. Basically it can be used as a central point to do the conversion
> with functions like :
>
> CFURLCreateFromFSRef(CFAllocatorRef allocator, const FSRef *fsRef);
> CFURLGetFSRef(CFURLRef url, FSRef *fsRef);
> CFURLGetFileSystemRepresentation(CFURLRef url, Boolean
> resolveAgainstBase, UInt8 *buffer, CFIndex maxBufLen);
> CFURLCreateWithFileSystemPath(CFAllocatorRef allocator, CFStringRef
> filePath, CFURLPathStyle pathStyle, Boolean isDirectory);
>
> There may be a function that does that directly somewhere around hfs
> files but on top of my head I do not remember :-(.
>
> Hope this helps
>
> Laurent
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: coremidi & codewarrior
      • From: Doug Wyatt <email@hidden>
References: 
 >Re: coremidi & codewarrior (From: Laurent Cerveau <email@hidden>)

  • Prev by Date: Re: Questions on data in MIDIPackets
  • Next by Date: Re: Which Macs have AppleTexasAudio driver?
  • Previous by thread: Re: coremidi & codewarrior
  • Next by thread: Re: coremidi & codewarrior
  • Index(es):
    • Date
    • Thread