• 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
Creating a series of sequenced files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating a series of sequenced files


  • Subject: Creating a series of sequenced files
  • From: Carl Hoefs <email@hidden>
  • Date: Sat, 16 Apr 2016 14:36:16 -0700

I have a daemon process that needs to generate a series of sequenced files (named sequentially, such as "file_01944576_1.dat", "file_01944576_2.dat", etc.) in the same directory. Does Cocoa provide a way to do this?

NSFileManager's -createFileAtPath:contents:attributes: method states:
 "If a file already exists at path, this method overwrites the contents of that file..."

I would hate to do this blindly, such as with fstat() in a loop, because there will potentially be many sequences, and each can grow to an arbitrary number. How do Finder and other OS X agents accomplish this?
-Carl


_______________________________________________

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: Creating a series of sequenced files
      • From: Quincey Morris <email@hidden>
    • Re: Creating a series of sequenced files
      • From: Quincey Morris <email@hidden>
    • Re: Creating a series of sequenced files
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: Proper way to set up constants when building an iOS framework
  • Next by Date: Re: Creating a series of sequenced files
  • Previous by thread: Re: Signed App can't retrieve passwords from keychain
  • Next by thread: Re: Creating a series of sequenced files
  • Index(es):
    • Date
    • Thread