Sha256: eda1f6289b4a61e5ca5105a53a3d61b1df9729ff9b005bbcc1be5fe2f47d6a55
Contents?: true
Size: 1.23 KB
Versions: 8
Compression:
Stored size: 1.23 KB
Contents
// // iCukeServer.m // iCuke // // Created by Rob Holland on 01/03/2010. // Copyright 2010 The IT Refinery. All rights reserved. // #import "iCukeServer.h" #include <unistd.h> @implementation iCukeServer + (void)start { [[iCukeHTTPServer sharediCukeHTTPServer] start]; NSFileManager *fileManager= [[NSFileManager alloc] init]; NSArray *paths; NSString *preferences = [NSHomeDirectory() stringByAppendingPathComponent: @"Library/Preferences"]; paths = [fileManager contentsOfDirectoryAtPath: preferences error: NULL]; for (NSString *path in paths) { if (![path hasPrefix: @"."]) { NSLog(@"Removing: %@", path); unlink([[preferences stringByAppendingPathComponent: path] cStringUsingEncoding: [NSString defaultCStringEncoding]]); } } NSString *documents = [NSHomeDirectory() stringByAppendingPathComponent: @"Documents"]; paths = [fileManager contentsOfDirectoryAtPath: documents error: NULL]; for (NSString *path in paths) { if (![path hasPrefix: @"."]) { NSLog(@"Removing: %@", path); unlink([[documents stringByAppendingPathComponent: path] cStringUsingEncoding: [NSString defaultCStringEncoding]]); } } } @end void start_server(void) __attribute__((constructor)); void start_server(void) { [iCukeServer start]; }
Version data entries
8 entries across 8 versions & 1 rubygems