• 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: Handling of paths through sandbox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling of paths through sandbox


  • Subject: Re: Handling of paths through sandbox
  • From: Quincey Morris via Cocoa-dev <email@hidden>
  • Date: Wed, 12 Feb 2020 18:54:29 -0800

On Feb 12, 2020, at 08:56 , Gabriel Zachmann <email@hidden> wrote:
>
> So rather than having the last part being chopped off (which is the important
> part),
> I would like to remove the beginning of the path, since that is unimportant.

For partial paths, you can try converting the URLs to URLComponents, then
constructing a relative URL whose base URL is the directory you searched in.
That might give you a relative path that you can display.

If that doesn’t give a suitable result, you’ll have to do a bit of work, but
not much. Starting from a file URL, starting taking the last component of the
URL (property “lastPathComponent”), and building it up into a path string. Keep
removing the last component until the shortened URL equals the pictures
directory.

That’s a bit hand-wavy on the details, but it shouldn’t be too hard to code.

_______________________________________________

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: 
 >Handling of paths through sandbox (From: Gabriel Zachmann via Cocoa-dev <email@hidden>)
 >Re: Handling of paths through sandbox (From: Quincey Morris via Cocoa-dev <email@hidden>)
 >Re: Handling of paths through sandbox (From: Gabriel Zachmann via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: Handling of paths through sandbox
  • Next by Date: kCGImageStatusInvalidData
  • Previous by thread: Re: Handling of paths through sandbox
  • Next by thread: Catching keystrokes in my screensaver under Catalina
  • Index(es):
    • Date
    • Thread