ObjFW  Diff

Differences From Artifact [214e7cf8ea]:

To Artifact [7dcc3acfc8]:


391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428

#ifndef _PSP
+ (void)changeModeOfFileAtPath: (OFString*)path
			  mode: (mode_t)mode
{
# ifndef _WIN32
	if (chmod([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], mode))
		@throw [OFChangeFileModeFailedException
		    exceptionWithClass: self
				  path: path
				  mode: mode];
# else
	DWORD attributes = GetFileAttributesW([path UTF16String]);

	if (attributes == INVALID_FILE_ATTRIBUTES)
		@throw [OFChangeFileModeFailedException
		    exceptionWithClass: self
				  path: path
				  mode: mode];

	if ((mode / 100) & 2)
		attributes &= ~FILE_ATTRIBUTE_READONLY;
	else
		attributes |= FILE_ATTRIBUTE_READONLY;

	if (!SetFileAttributesW([path UTF16String], attributes))
		@throw [OFChangeFileModeFailedException
		    exceptionWithClass: self
				  path: path
				  mode: mode];
# endif
}
#endif

+ (off_t)sizeOfFileAtPath: (OFString*)path
{
#ifndef _WIN32
	struct stat s;







<
<
<
<

|
|
<




<
<
<
<
<
<
<
<
<
<
<
<







391
392
393
394
395
396
397




398
399
400

401
402
403
404












405
406
407
408
409
410
411

#ifndef _PSP
+ (void)changeModeOfFileAtPath: (OFString*)path
			  mode: (mode_t)mode
{
# ifndef _WIN32
	if (chmod([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE], mode))




# else
	if (_wchmod([path UTF16String], mode))
# endif

		@throw [OFChangeFileModeFailedException
		    exceptionWithClass: self
				  path: path
				  mode: mode];












}
#endif

+ (off_t)sizeOfFileAtPath: (OFString*)path
{
#ifndef _WIN32
	struct stat s;