ObjFW  Diff

Differences From Artifact [3489cc9954]:

To Artifact [f8ec01874b]:


20
21
22
23
24
25
26
27
28


29
30
31


32
33
34
35
36
37
38
20
21
22
23
24
25
26


27
28
29


30
31
32
33
34
35
36
37
38







-
-
+
+

-
-
+
+







#import <sys/stat.h>
#endif

#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
{
	/*
	 * FIXME: On error, throw exception
179
180
181
182
183
184
185








186
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194







+
+
+
+
+
+
+
+


- (size_t)writeCString: (const char*)str
{
	return [self writeNItems: strlen(str)
			  ofSize: 1
		      fromBuffer: (const uint8_t*)str];
}

- close
{
	fclose(fp);
	fp = NULL;

	return self;
}
@end