• 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: How to know if a file has been opened before?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to know if a file has been opened before?


  • Subject: Re: How to know if a file has been opened before?
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Tue, 05 Jun 2012 08:45:13 -0500

On Tue, Jun 5, 2012 at 3:14 AM, Antonio Nunes <email@hidden> wrote:
> On 5 Jun 2012, at 00:09, Stephen J. Butler wrote:
>
>> You can use extended attributes to attach information to a file. Maybe
>> serialize your session state as a plist and use setxattr/getxattr to
>> manipulate it. Follows the file as it's moved around.
>
> Thanks Stephen,
>
> I think the extended attributes are pretty persistent though, they'll follow the file around across to other computers, right? I wouldn't want that. I only need the data on the particular user's system. Starting to look like l'm probably better off devising my own scheme.

In general, yes. It won't follow if you upload to a website, say
Dropbox, and then someone else downloads it. But if you copy it to a
thumb drive and send it then it will.

One thing you could try is to mix the two ideas. Generate a GUID for
each file and store that in the extended attribute. Then use the GUID
to lookup your session information in an application CoreData store or
simple SQLite database.

Then only the GUID follows the file around, and on another machine it
won't have the session information and you can create it fresh. Also,
you'll have to handle the case when a file doesn't have a GUID in its
extended attributes and attach a new one.

_______________________________________________

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

  • Follow-Ups:
    • Re: How to know if a file has been opened before?
      • From: Antonio Nunes <email@hidden>
    • Re: How to know if a file has been opened before?
      • From: Jens Alfke <email@hidden>
References: 
 >How to know if a file has been opened before? (From: Antonio Nunes <email@hidden>)
 >Re: How to know if a file has been opened before? (From: "Stephen J. Butler" <email@hidden>)
 >Re: How to know if a file has been opened before? (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: adding space for 'annotations' with a typesetter subclass
  • Next by Date: Re: How to know if a file has been opened before?
  • Previous by thread: Re: How to know if a file has been opened before?
  • Next by thread: Re: How to know if a file has been opened before?
  • Index(es):
    • Date
    • Thread