Differences From Artifact [25d73bc7b8]:
- File
src/OFFile.m
— part of check-in
[9ddd33a258]
at
2013-01-12 17:29:24
on branch trunk
— Rename *UsingEncoding: to *WithEncoding:.
This reverts 5362941.
Even though *UsingEncoding: is what Foundation uses, *WithEncoding: is
more natural and is more consistent with the rest. Also, this means this
restores it to the API of 0.7. (user: js, size: 18480) [annotate] [blame] [check-ins using]
To Artifact [9af0a75ec0]:
- File src/OFFile.m — part of check-in [b8ce2359f3] at 2013-01-12 20:53:54 on branch trunk — Clean up the feature #ifdef mess. (user: js, size: 18505) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
39 40 41 42 43 44 45 | # include <pwd.h> # include <grp.h> #endif #import "OFFile.h" #import "OFString.h" #import "OFArray.h" | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | # include <pwd.h> # include <grp.h> #endif #import "OFFile.h" #import "OFString.h" #import "OFArray.h" #ifdef OF_HAVE_THREADS # import "threading.h" #endif #import "OFDate.h" #import "OFApplication.h" #import "OFSystemInfo.h" #import "OFChangeDirectoryFailedException.h" |
︙ | ︙ | |||
97 98 99 100 101 102 103 | #define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH #define DIR_MODE DEFAULT_MODE | S_IXUSR | S_IXGRP | S_IXOTH OFStream *of_stdin = nil; OFStream *of_stdout = nil; OFStream *of_stderr = nil; | | | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | #define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH #define DIR_MODE DEFAULT_MODE | S_IXUSR | S_IXGRP | S_IXOTH OFStream *of_stdin = nil; OFStream *of_stdout = nil; OFStream *of_stderr = nil; #if defined(OF_HAVE_THREADS) && !defined(_WIN32) static of_mutex_t mutex; #endif static int parse_mode(const char *mode) { if (!strcmp(mode, "r")) return O_RDONLY; |
︙ | ︙ | |||
158 159 160 161 162 163 164 | objc_autoreleasePoolPop(pool); } @interface OFFileSingleton: OFFile @end @implementation OFFile | | | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | objc_autoreleasePoolPop(pool); } @interface OFFileSingleton: OFFile @end @implementation OFFile #if defined(OF_HAVE_THREADS) && !defined(_WIN32) + (void)initialize { if (self != [OFFile class]) return; if (!of_mutex_new(&mutex)) @throw [OFInitializationFailedException |
︙ | ︙ | |||
471 472 473 474 475 476 477 | uid_t uid = -1; gid_t gid = -1; if (owner == nil && group == nil) @throw [OFInvalidArgumentException exceptionWithClass: self selector: _cmd]; | | | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | uid_t uid = -1; gid_t gid = -1; if (owner == nil && group == nil) @throw [OFInvalidArgumentException exceptionWithClass: self selector: _cmd]; # ifdef OF_HAVE_THREADS if (!of_mutex_lock(&mutex)) @throw [OFLockFailedException exceptionWithClass: self]; @try { # endif if (owner != nil) { struct passwd *passwd; |
︙ | ︙ | |||
504 505 506 507 508 509 510 | exceptionWithClass: self path: path owner: owner group: group]; gid = group_->gr_gid; } | | | 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | exceptionWithClass: self path: path owner: owner group: group]; gid = group_->gr_gid; } # ifdef OF_HAVE_THREADS } @finally { if (!of_mutex_unlock(&mutex)) @throw [OFUnlockFailedException exceptionWithClass: self]; } # endif |
︙ | ︙ |