implement setAttributes:ofItemAtPath:error: method

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/gnustep_testplant_branch@40428 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2017-03-28 20:49:59 +00:00 committed by Frederik Carlier
parent 1cb6ef8572
commit bf586eca1b
2 changed files with 10 additions and 0 deletions

View file

@ -313,6 +313,8 @@ GS_EXPORT_CLASS
- (BOOL) createSymbolicLinkAtPath: (NSString*)path
withDestinationPath: (NSString*)destPath
error: (NSError**)error;
- (BOOL) setAttributes:(NSDictionary *)attributes ofItemAtPath:(NSString *)path error:(NSError **)error;
#endif
/**

View file

@ -685,6 +685,14 @@ static NSStringEncoding defaultEncoding;
return allOk;
}
- (BOOL) setAttributes:(NSDictionary *)attributes ofItemAtPath:(NSString *)path error:(NSError **)error
{
BOOL success = [self changeFileAttributes: attributes atPath: path];
if (!success && error != NULL)
*error = [NSError _last];
return success;
}
/**
* Returns an array of path components suitably modified for display
* to the end user. This modification may render the returned strings