ObjFW  Diff

Differences From Artifact [112f36f53a]:

To Artifact [c32b62d50c]:


97
98
99
100
101
102
103













104
105
106
107
108
109
110
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123







+
+
+
+
+
+
+
+
+
+
+
+
+







				      mode: mode] autorelease];
}

+ fileWithFileDescriptor: (int)fd_
{
	return [[[self alloc] initWithFileDescriptor: fd_] autorelease];
}

+ (BOOL)fileExistsAtPath: (OFString*)path
{
	struct stat s;

	if (stat([path cString], &s) == -1)
		return NO;

	if (S_ISREG(s.st_mode))
		return YES;

	return NO;
}

+ (void)changeModeOfFile: (OFString*)path
		  toMode: (mode_t)mode
{
#ifndef _WIN32
	if (chmod([path cString], mode))
		@throw [OFChangeFileModeFailedException newWithClass: self