Skip to content

Instantly share code, notes, and snippets.

@below
Created October 28, 2014 12:41
Show Gist options
  • Save below/2b652f066dc0a5059aa4 to your computer and use it in GitHub Desktop.
Save below/2b652f066dc0a5059aa4 to your computer and use it in GitHub Desktop.
Swift FileHandle Test
// Playground - noun: a place where people can play
import Cocoa
import XCPlayground
let path = XCPSharedDataDirectoryPath + "log.txt"
let fileURL = NSURL(fileURLWithPath: path)
if (fileURL != nil) {
var error : NSError? = nil;
let fileHandle = NSFileHandle(forWritingToURL: fileURL!, error:&error)
print(error)
if (error == nil) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment