@@ -13,21 +13,19 @@ #include #include #include -#ifndef _WIN32 #include #include -#endif #import "OFFile.h" #import "OFString.h" #import "OFExceptions.h" #ifdef _WIN32 -#import +# import #endif OFFile *of_stdin = nil; OFFile *of_stdout = nil; OFFile *of_stderr = nil; @@ -81,25 +79,22 @@ path: path mode: mode]; #endif } +#ifndef _WIN32 + (void)changeOwnerOfFile: (OFString*)path toOwner: (uid_t)owner group: (gid_t)group { -#ifndef _WIN32 if (chown([path cString], owner, group)) @throw [OFChangeFileOwnerFailedException newWithClass: self path: path owner: owner group: group]; -#else - @throw [OFNotImplementedException newWithClass: self - selector: _cmd]; -#endif } +#endif + (void)rename: (OFString*)from to: (OFString*)to { #ifndef _WIN32 @@ -121,37 +116,29 @@ #endif @throw [OFDeleteFileFailedException newWithClass: self path: path]; } +#ifndef _WIN32 + (void)link: (OFString*)src to: (OFString*)dest { -#ifndef _WIN32 if (link([src cString], [dest cString]) != 0) @throw [OFLinkFailedException newWithClass: self source: src destination: dest]; -#else - @throw [OFNotImplementedException newWithClass: self - selector: _cmd]; -#endif } + (void)symlink: (OFString*)src to: (OFString*)dest { -#ifndef _WIN32 if (symlink([src cString], [dest cString]) != 0) @throw [OFSymlinkFailedException newWithClass: self source: src destination: dest]; -#else - @throw [OFNotImplementedException newWithClass: self - selector: _cmd]; -#endif } +#endif - init { @throw [OFNotImplementedException newWithClass: isa selector: _cmd];