Re: NSTask and 10.9
Re: NSTask and 10.9
- Subject: Re: NSTask and 10.9
- From: Pax <email@hidden>
- Date: Tue, 26 Nov 2013 17:15:28 +0000
So:
NSFileManager *fileMgr = [NSFileManager defaultManager];
NSArray *contents = [fileMgr contentsOfDirectoryAtPath:<path> error:nil];
for (NSString *item in contents)
{
if ([item rangeOfString:<wildcard>].location !=NSNotFound)
{
[fileMgr removeItemAtPath:item error:NULL];
}
}
Please note that I haven't tested this - I've just pulled it out of my, erm, head. This is just the approach that I'd take. Change <path> and <wildcard> as appropriate.
On 26 Nov 2013, at 16:42, koko <email@hidden> wrote:
>
> On Nov 26, 2013, at 8:56 AM, Pax <email@hidden> wrote:
>
>> hy would you delete files in this manner?
>
> Need to wildcard the file names.
_______________________________________________
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