Differences From Artifact [cdb8ca685b]:
- File
src/OFFile.m
— part of check-in
[5f4f207266]
at
2010-04-02 15:58:39
on branch trunk
— Use open() / read() / write() instead of fopen() / fread() / fwrite().
This fixes reading from stdin. (user: js, size: 5948) [annotate] [blame] [check-ins using]
To Artifact [d214a82c1c]:
- File src/OFFile.m — part of check-in [0c99c954e2] at 2010-04-03 01:47:35 on branch trunk — Pass a default mode to open(). (user: js, size: 6022) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # import <windows.h> #endif #ifndef O_BINARY # define O_BINARY 0 #endif OFFile *of_stdin = nil; OFFile *of_stdout = nil; OFFile *of_stderr = nil; static int parse_mode(const char *mode) { if (!strcmp(mode, "r")) | > > | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # import <windows.h> #endif #ifndef O_BINARY # define O_BINARY 0 #endif #define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH OFFile *of_stdin = nil; OFFile *of_stdout = nil; OFFile *of_stderr = nil; static int parse_mode(const char *mode) { if (!strcmp(mode, "r")) |
︙ | ︙ | |||
195 196 197 198 199 200 201 | if ((flags = parse_mode([mode cString])) == -1) { c = isa; [super dealloc]; @throw [OFInvalidArgumentException newWithClass: c selector: _cmd]; } | | | 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | if ((flags = parse_mode([mode cString])) == -1) { c = isa; [super dealloc]; @throw [OFInvalidArgumentException newWithClass: c selector: _cmd]; } if ((fd = open([path cString], flags, DEFAULT_MODE)) == -1) { c = isa; [super dealloc]; @throw [OFOpenFileFailedException newWithClass: c path: path mode: mode]; } |
︙ | ︙ |