• 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: Dragging broken symlinks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dragging broken symlinks


  • Subject: Re: Dragging broken symlinks
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sat, 9 Aug 2008 14:25:24 +0700


On 9 Aug 2008, at 12:27, Ken Thomases wrote:

On Aug 8, 2008, at 11:26 PM, Gerriet M. Denkmann wrote:

I have an app which can open symlinks (not the thing the symlink points to). Done via
[ openPanel setResolvesAliases: NO ];


But when I drag a symlink to the icon of my app in the dock, - (BOOL)application:(NSApplication *)theApplication openFile: (NSString *)filename
will have filename = content of symlink (or alias).
And in case of a broken symlink nothing happens at all.


How can I open broken symlinks by dragging?

There's a good chance that you can't. It may be that Launch Services, which is used by the Dock or the Finder to pass the open- document request to your application in response to your drag operation, has already resolved the symlink (or attempted to do so).


You could try installing a handler for the 'odoc' Apple Event to see if you can override Cocoa's handling. I don't know if the framework will let you do that.
Did that. But the 'odoc' event I get contains an 'alis' which contains the content of the symlink. And no 'odoc' at all for a broken symlink.
So obviously the Dock (or whoever) already has done its evel magic.



You might have to build a Carbon application to test the possibility at a low level, with the Cocoa framework removed from the equation. If it's not possible there, it's almost certainly not possible in a Cocoa app. Using the DTSCarbonShell sample code as a starting point, it should be fairly easy to build such a test.

Well, this is more than I am prepared to invest. I just added the non- draggable nature of symlinks and aliases to the list of known bugs and will leave it at that.



Kind regards,

Gerriet.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Dragging broken symlinks (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Dragging broken symlinks (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: NSArrayController's selectedIndexes
  • Next by Date: Using @selector()
  • Previous by thread: Re: Dragging broken symlinks
  • Next by thread: NSArrayController's selectedIndexes
  • Index(es):
    • Date
    • Thread