diff --git a/ChangeLog b/ChangeLog index fff1623e1..4cbcddff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * Source/NSBundle.m: AbsolutePathOfExecutable() attempt to fix this to return a fully standardised path without symbolic links. + * Source/NSFileManager.m: + * Headers/Foundation/NSFileManager.h: + Rudimentary implementation of a couple of new methods. 2011-03-05 Tom Davie diff --git a/Headers/Foundation/NSFileManager.h b/Headers/Foundation/NSFileManager.h index aee9be91e..d49f4ba25 100644 --- a/Headers/Foundation/NSFileManager.h +++ b/Headers/Foundation/NSFileManager.h @@ -219,6 +219,12 @@ typedef uint32_t OSType; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSDictionary *) attributesOfItemAtPath: (NSString*)path error: (NSError**)error; +- (BOOL) copyItemAtPath: (NSString*)src + toPath: (NSString*)dst + error: (NSError**)error; +- (BOOL) moveItemAtPath: (NSString*)src + toPath: (NSString*)dst + error: (NSError**)error; #endif - (BOOL) changeCurrentDirectoryPath: (NSString*)path; diff --git a/Source/NSFileManager.m b/Source/NSFileManager.m index af7a27424..cd2e14f32 100644 --- a/Source/NSFileManager.m +++ b/Source/NSFileManager.m @@ -1125,6 +1125,16 @@ static NSStringEncoding defaultEncoding; return YES; } +- (BOOL) copyItemAtPath: (NSString*)src + toPath: (NSString*)dst + error: (NSError**)error +{ + BOOL result; + + result = [self copyPath: src toPath: dst handler: nil]; + return result; +} + /** * Moves the file or directory at source to destination, using a * handler object which should respond to @@ -1211,6 +1221,16 @@ static NSStringEncoding defaultEncoding; return NO; } +- (BOOL) moveItemAtPath: (NSString*)src + toPath: (NSString*)dst + error: (NSError**)error +{ + BOOL result; + + result = [self movePath: src toPath: dst handler: nil]; + return result; +} + /** *

Links the file or directory at source to destination, using a * handler object which should respond to