ObjFW  Diff

Differences From Artifact [f9f8e25035]:

To Artifact [87ff6efbc7]:


260
261
262
263
264
265
266
267
268


269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289


290
291
292
293
294
295
296
297
298


299
300
301
302
303
304
305
260
261
262
263
264
265
266


267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287


288
289
290
291
292
293
294
295
296


297
298
299
300
301
302
303
304
305







-
-
+
+



















-
-
+
+







-
-
+
+







{
#ifndef _WIN32
	if (rename([from cString], [to cString]))
#else
	if (!MoveFile([from cString], [to cString]))
#endif
		@throw [OFRenameFileFailedException newWithClass: self
							    from: from
							      to: to];
						      sourcePath: from
						 destinationPath: to];
}

+ (void)deleteFileAtPath: (OFString*)path
{
#ifndef _WIN32
	if (unlink([path cString]))
#else
	if (!DeleteFile([path cString]))
#endif
		@throw [OFDeleteFileFailedException newWithClass: self
							    path: path];
}

#ifndef _WIN32
+ (void)linkFileAtPath: (OFString*)src
		toPath: (OFString*)dest
{
	if (link([src cString], [dest cString]) != 0)
		@throw [OFLinkFailedException newWithClass: self
						    source: src
					       destination: dest];
						sourcePath: src
					   destinationPath: dest];
}

+ (void)symlinkFileAtPath: (OFString*)src
		   toPath: (OFString*)dest
{
	if (symlink([src cString], [dest cString]) != 0)
		@throw [OFSymlinkFailedException newWithClass: self
						       source: src
						  destination: dest];
						   sourcePath: src
					      destinationPath: dest];
}
#endif

- init
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];