Creating a series of sequenced files
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