@@ -22,15 +22,15 @@ #import "OFFile.h" #import "OFExceptions.h" @implementation OFFile -+ newWithPath: (const char*)path - andMode: (const char*)mode ++ fileWithPath: (const char*)path + andMode: (const char*)mode { - return [[self alloc] initWithPath: path - andMode: mode]; + return [[[self alloc] initWithPath: path + andMode: mode] autorelease]; } + (void)changeModeOfFile: (const char*)path toMode: (mode_t)mode { @@ -181,6 +181,14 @@ { return [self writeNItems: strlen(str) ofSize: 1 fromBuffer: (const uint8_t*)str]; } + +- close +{ + fclose(fp); + fp = NULL; + + return self; +} @end