• 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: Filesystem path that works even after a dir is moved?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filesystem path that works even after a dir is moved?


  • Subject: Re: Filesystem path that works even after a dir is moved?
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 02 Nov 2015 13:09:20 -0800


On Nov 2, 2015, at 12:39 PM, Dominic Giampaolo <email@hidden> wrote:

That could work.  Or you could create a CF/NSURL Bookmark to locate the document when the user tries to open it and then patch up any paths it stores before you ask your library of db code to open the db.

The problem is that the database code uses paths *while it’s running* to operate on files. For example, it creates and deletes temporary files next to the main database file. It stores the path of the database when it’s opened, and constructs the temp-file paths relative to that.

I could use various techniques to update the paths before any call I make to the library, but of course the directory could be moved in between that check and the actual filesystem call to open a temp file.


On Nov 2, 2015, at 12:25 PM, Chris Suter <email@hidden> wrote:

If you can change the third party library, look at openat.

That looks promising, although it requires 10.10. The library has a filesystem abstraction layer that I could hook this into. Presumably I’d create and open a scratch file in that directory, then use its fd as the base for openat.

I was about to ask how you _delete_ a file using this trick, but then I tried “man unlinkat” and that answers my question.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Filesystem path that works even after a dir is moved?
      • From: Chris Suter <email@hidden>
References: 
 >Filesystem path that works even after a dir is moved? (From: Jens Alfke <email@hidden>)
 >Re: Filesystem path that works even after a dir is moved? (From: Dominic Giampaolo <email@hidden>)

  • Prev by Date: Re: Filesystem path that works even after a dir is moved?
  • Next by Date: Re: Filesystem path that works even after a dir is moved?
  • Previous by thread: Re: Filesystem path that works even after a dir is moved?
  • Next by thread: Re: Filesystem path that works even after a dir is moved?
  • Index(es):
    • Date
    • Thread