Hmmm. The code I posted seems to work okay if the file contents are read from command-line tools such as "cat" or "less", or by looking at file:///Volumes/helloicns/hello.txt in Safari.
However, using Quick Look in Leopard Finder, or attempting to open with TextEdit or Xcode, causes those apps to crash every time. Strangely, the Quick Look thumbnail image looks okay. The files hello.txt and hello.txt/..namedfork/rsrc are binary identical (according to "diff" -- give or take some "reserved for" space in the resource fork, which can be made to be identical) to the ones created by the Objective-C HelloFuse. The file attributes are different, but running my code without the "icns_file" option (i.e. bypassing the code which returns the resource fork and Finder info) gives the same attributes but doesn't crash Finder et al. The trace of TextEdit crashing is as follows: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000001 Crashed Thread: 0 Thread 0 Crashed: 0 libSystem.B.dylib 0xffff0800 __memcpy + 96 1 com.apple.Foundation 0x919b4b6f _NSEncodingFromDataForExtendedAttribute + 271 2 com.apple.AppKit 0x944c2be8 _NSReadAttributedStringFromURLOrData + 4882 3 com.apple.AppKit 0x944f4d65 -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) readFromURL:options:documentAttributes:error:] + 53 4 com.apple.TextEdit 0x00005967 0x1000 + 18791 5 com.apple.TextEdit 0x000056c0 0x1000 + 18112 6 com.apple.AppKit 0x9447a8bd -[NSDocument initWithContentsOfURL:ofType:error:] + 311 7 com.apple.AppKit 0x94612d4f -[NSDocumentController makeDocumentWithContentsOfURL:ofType:error:] + 391 8 com.apple.AppKit 0x94612b55 -[NSDocumentController openDocumentWithContentsOfURL:display:error:] + 420 9 com.apple.TextEdit 0x0000ee42 0x1000 + 56898 10 com.apple.AppKit 0x942728da -[NSDocumentController(NSInternal) _openFile:] + 143 11 com.apple.AppKit 0x9427247a -[NSApplication _doOpenFile:ok:tryTemp:] + 691 12 com.apple.AppKit 0x943750e9 -[NSApplication _doOpenFiles:] + 242 13 com.apple.AppKit 0x94374fd8 -[NSApplication(NSAppleEventHandling) _handleAEOpenDocuments:] + 88 14 com.apple.AppKit 0x942770d1 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 792 15 com.apple.Foundation 0x9185afff -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 655 16 com.apple.Foundation 0x9185ad0f _NSAppleEventManagerGenericHandler + 223 17 com.apple.AE 0x9031d39a aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*) + 144 18 com.apple.AE 0x9031aa88 dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 44 19 com.apple.AE 0x9031cd09 aeProcessAppleEvent + 177 20 com.apple.HIToolbox 0x91c12dc0 AEProcessAppleEvent + 38 21 com.apple.AppKit 0x94275407 _DPSNextEvent + 1189 22 com.apple.AppKit 0x94274b47 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128 23 com.apple.AppKit 0x9426ecc7 -[NSApplication run] + 795 24 com.apple.AppKit 0x94261f82 NSApplicationMain + 663 25 com.apple.TextEdit 0x00001f17 0x1000 + 3863 26 com.apple.TextEdit 0x000054f1 0x1000 + 17649 27 ??? 0x00000002 0 + 2 Any ideas? Thanks, Hamish On 8/16/07, Hamish Allan <[EMAIL PROTECTED]> wrote: > I've just posted my file icon code for HELLOWORLDFS as a comment to > its Wiki page: > > http://code.google.com/p/macfuse/wiki/HELLOWORLDFS > > Hope it's of use to someone! > > Best wishes, > Hamish > > P.S. It should be straightforward to use my simpleresourcefork.h to > remove FUSEObjC's dependencies on GTResourceFork and IconFamily. > P.P.S. I still think a "magic_dotunderscorefiles" option in MacFUSE > might be useful for 10.4 Finder... > P.P.P.S. Custom volume icons don't seem to work in 10.5 Finder. Has > their handling changed? > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "macfuse-devel" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/macfuse-devel?hl=en -~----------~----~----~----~------~----~------~--~---
