Differences From Artifact [4b4f8f0aeb]:
- File
src/OFFileManager.m
— part of check-in
[4ebeb7e3a2]
at
2017-06-03 12:46:40
on branch trunk
— Make of_(l)stat() private to OFFileManager
Everything else should just use OFFileManager. (user: js, size: 25470) [annotate] [blame] [check-ins using]
To Artifact [ce2f7bd650]:
- File src/OFFileManager.m — part of check-in [4175b93242] at 2017-06-03 14:37:19 on branch trunk — OFFileManager: Mask modes to ensure safe modes (user: js, size: 25192) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
67 68 69 70 71 72 73 | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif | < < < < < < < < < < < < < < < < | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | #ifdef OF_WINDOWS # include <windows.h> # include <direct.h> # include <ntdef.h> #endif #if defined(OF_WINDOWS) typedef struct __stat64 of_stat_t; #elif defined(OF_HAVE_OFF64_T) typedef struct stat64 of_stat_t; #else typedef struct stat of_stat_t; #endif |
︙ | ︙ | |||
275 276 277 278 279 280 281 | - (void)createDirectoryAtPath: (OFString *)path { if (path == nil) @throw [OFInvalidArgumentException exception]; #ifndef OF_WINDOWS if (mkdir([path cStringWithEncoding: [OFLocalization encoding]], | | | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | - (void)createDirectoryAtPath: (OFString *)path { if (path == nil) @throw [OFInvalidArgumentException exception]; #ifndef OF_WINDOWS if (mkdir([path cStringWithEncoding: [OFLocalization encoding]], 0777) != 0) #else if (_wmkdir([path UTF16String]) != 0) #endif @throw [OFCreateDirectoryFailedException exceptionWithPath: path errNo: errno]; } |
︙ | ︙ | |||
513 514 515 516 517 518 519 | errNo: errno]; /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_ctime]; } #ifdef OF_HAVE_CHMOD | | | | > > | 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | errNo: errno]; /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_ctime]; } #ifdef OF_HAVE_CHMOD - (uint16_t)permissionsOfItemAtPath: (OFString *)path { of_stat_t s; if (path == nil) @throw [OFInvalidArgumentException exception]; if (of_stat(path, &s) != 0) @throw [OFStatItemFailedException exceptionWithPath: path errNo: errno]; return s.st_mode & 07777; } - (void)changePermissionsOfItemAtPath: (OFString *)path permissions: (uint16_t)permissions { if (path == nil) @throw [OFInvalidArgumentException exception]; permissions &= 0777; # ifndef OF_WINDOWS if (chmod([path cStringWithEncoding: [OFLocalization encoding]], permissions) != 0) # else if (_wchmod([path UTF16String], permissions) != 0) # endif |
︙ | ︙ |