@@ -43,36 +43,20 @@ * It is not closed when the OFFile object is deallocated! * \return A new autoreleased OFFile */ + fileWithFilePointer: (FILE*)fp; -/** - * \return An OFFile singleton for stdin - */ -+ standardInput; - -/** - * \return An OFFile singleton for stdout - */ -+ standardOutput; - -/** - * \return An OFFile singleton for stderr - */ -+ standardError; - /** * Changes the mode of a file. * * Not available on Windows. * * \param path The path to the file of which the mode should be changed as a * string * \param mode The new mode for the file - * \return A boolean whether the operation succeeded */ -+ (BOOL)changeModeOfFile: (OFString*)path ++ (void)changeModeOfFile: (OFString*)path toMode: (mode_t)mode; /** * Changes the owner of a file. * @@ -80,21 +64,28 @@ * * \param path The path to the file of which the owner should be changed as a * string * \param owner The new owner for the file * \param group The new group for the file - * \return A boolean whether the operation succeeded */ -+ (BOOL)changeOwnerOfFile: (OFString*)path - owner: (uid_t)owner ++ (void)changeOwnerOfFile: (OFString*)path + toOwner: (uid_t)owner group: (gid_t)group; +/** + * Renames a file. + * + * \param from The file to rename + * \param to The new name + */ ++ (void)rename: (OFString*)from + to: (OFString*)to; + /** * Deletes a file. * * \param path The path to the file of which should be deleted as a string - * \return A boolean whether the operation succeeded */ + (void)delete: (OFString*)path; /** * Hardlinks a file. @@ -101,11 +92,10 @@ * * Not available on Windows. * * \param src The path to the file of which should be linked as a string * \param dest The path to where the file should be linked as a string - * \return A boolean whether the operation succeeded */ + (void)link: (OFString*)src to: (OFString*)dest; /** @@ -113,11 +103,10 @@ * * Not available on Windows. * * \param src The path to the file of which should be symlinked as a string * \param dest The path to where the file should be symlinked as a string - * \return A boolean whether the operation succeeded */ + (void)symlink: (OFString*)src to: (OFString*)dest; /** @@ -165,5 +154,12 @@ fromBuffer: (const char*)buf; @end @interface OFFileSingleton: OFFile @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;