Re: Dragging broken symlinks

2008-08-09 Thread Gerriet M. Denkmann


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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Dragging broken symlinks

2008-08-08 Thread Ken Thomases

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.


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.


Cheers,
Ken
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]