Differences From Artifact [5e8cf7bcda]:
- File src/OFFile.h — part of check-in [42886185fd] at 2010-02-19 16:36:20 on branch trunk — Update copyright. (user: js, size: 3138) [annotate] [blame] [check-ins using] [more...]
To Artifact [e16ab950d2]:
- File
src/OFFile.h
— 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: 3156) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
18 19 20 21 22 23 24 | @class OFString; /** * \brief A class which provides functions to read, write and manipulate files. */ @interface OFFile: OFStream { | | | > | | | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | @class OFString; /** * \brief A class which provides functions to read, write and manipulate files. */ @interface OFFile: OFStream { int fd; BOOL closable; BOOL eos; } /** * \param path The path to the file to open as a string * \param mode The mode in which the file should be opened as a string * \return A new autoreleased OFFile */ + fileWithPath: (OFString*)path mode: (OFString*)mode; /** * \param fd A file descriptor, returned from for example open(). * It is not closed when the OFFile object is deallocated! * \return A new autoreleased OFFile */ + fileWithFileDescriptor: (int)fd; /** * Changes the mode of a file. * * Only changes read-only flag on Windows. * * \param path The path to the file of which the mode should be changed as a |
︙ | ︙ | |||
118 119 120 121 122 123 124 | */ - initWithPath: (OFString*)path mode: (OFString*)mode; /** * Initializes an already allocated OFFile. * | | | | 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | */ - initWithPath: (OFString*)path mode: (OFString*)mode; /** * Initializes an already allocated OFFile. * * \param fd A file descriptor, returned from for example open(). * It is not closed when the OFFile object is deallocated! */ - initWithFileDescriptor: (int)fd; @end /// An OFFile object for stdin extern OFFile *of_stdin; /// An OFFile object for stdout extern OFFile *of_stdout; /// An OFFile object for stderr extern OFFile *of_stderr; |