• 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: Automatically mirroring folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatically mirroring folders


  • Subject: Re: Automatically mirroring folders
  • From: Matt Gough <email@hidden>
  • Date: Mon, 20 Jun 2011 08:53:40 +0100

Can you not make use of:

kFSEventStreamCreateFlagIgnoreSelf
"Ignore events generated by this client. For example, an application might want to watch for changes to a file so that it can reread it, but should not needlessly reread it if the change to the file was caused by the application itself writing out changes."

Matt

On 19 Jun 2011, at 17:48:32, Leonardo wrote:

> Problem: I have to automatically mirror 2 folders, /A and /B, such a way
> they contains the same files and folders.
>
> - So I FSEventStreamCreate with kFSEventStreamEventIdSinceNow,
> kFSEventStreamCreateFlagWatchRoot and a 2 seconds latency time.
>
> - I get a notification: there is a new file to copy from /A to /B. I copy
> the file, but I quickly get a new notification that there is a new file in
> B. Well, this notification is useless to me. I copied that file. Therefore I
> don't need to copy it again.
>
> - So, before I copy the file, I thought, I stop and invalidate the stream,
> then I copy the file, then I turn the stream on again. But here I get 2
> problems:
>
> 1) At the end of the copyFile, I turn the stream on again, and the Finder, a
> couple of seconds later (but it could even be shorter or longer) updates the
> /B/.DS_Store file so I get a new notification. How to force the Finder to
> update the .DS_Store file immediately after the copy? Or should I use a
> longer latency time? How long?
>
> 2) During the period of time the stream is off, if some new files arrive
> within the folder /A, I lose the notification to copy it.
>
> How to workaround that?
>
>
> Regards
> -- Leonardo
>
>
> _______________________________________________
>
> 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

_______________________________________________

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: Automatically mirroring folders
      • From: Leonardo <email@hidden>
    • Re: Automatically mirroring folders
      • From: Tony Romano <email@hidden>
References: 
 >Automatically mirroring folders (From: Leonardo <email@hidden>)

  • Prev by Date: Re: How to redraw a view in slow-motion
  • Next by Date: Re: If No Memory Leaks, Is It Good Enough for Memory Management?
  • Previous by thread: Re: Automatically mirroring folders
  • Next by thread: Re: Automatically mirroring folders
  • Index(es):
    • Date
    • Thread