@@ -13,12 +13,14 @@ #import #import #import +#ifndef _WIN32 #import #import +#endif #import "OFFile.h" #import "OFExceptions.h" @implementation OFFile @@ -27,44 +29,50 @@ { return [[self alloc] initWithPath: path andMode: mode]; } +#ifndef _WIN32 + (BOOL)changeModeOfFile: (const char*)path - toMode: (mode_t)mode + toMode: (mode_t)mode { // FIXME: On error, throw exception return (chmod(path, mode) == 0 ? YES : NO); } +#endif +#ifndef _WIN32 + (BOOL)changeOwnerOfFile: (const char*)path - toOwner: (uid_t)owner - andGroup: (gid_t)group + toOwner: (uid_t)owner + andGroup: (gid_t)group { // FIXME: On error, throw exception return (chown(path, owner, group) == 0 ? YES : NO); } +#endif + (BOOL)delete: (const char*)path { // FIXME: On error, throw exception return (unlink(path) == 0 ? YES : NO); } +#ifndef _WIN32 + (BOOL)link: (const char*)src - to: (const char*)dest + to: (const char*)dest { // FIXME: On error, throw exception return (link(src, dest) == 0 ? YES : NO); } + (BOOL)symlink: (const char*)src - to: (const char*)dest + to: (const char*)dest { // FIXME: On error, throw exception return (symlink(src, dest) == 0 ? YES : NO); } +#endif - initWithPath: (const char*)path andMode: (const char*)mode { if ((self = [super init])) {