mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Add new symbolic link method to NSFileManager.
This commit is contained in:
parent
4b56172ac8
commit
97f9a02308
3 changed files with 35 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2017-12-03 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Headers/Foundation/NSFileManager.h
|
||||
* Source/NSFileManager.m: Correct setting the delegate.
|
||||
Add new symbolic link method.
|
||||
|
||||
2017-11-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSArray.m: Fix for bug reported on github by zneak.
|
||||
|
|
|
@ -302,6 +302,14 @@ typedef NSUInteger NSDirectoryEnumerationOptions;
|
|||
*/
|
||||
- (BOOL) removeItemAtURL: (NSURL*)url
|
||||
error: (NSError**)error;
|
||||
/**
|
||||
* Creates a symbolic link at the path
|
||||
* that point to the destination path.<br />
|
||||
* Returns YES on success, otherwise NO.
|
||||
*/
|
||||
- (BOOL) createSymbolicLinkAtPath: (NSString*)path
|
||||
withDestinationPath: (NSString*)destPath
|
||||
error: (NSError**)error;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -361,7 +361,7 @@ static NSStringEncoding defaultEncoding;
|
|||
return _delegate;
|
||||
}
|
||||
|
||||
- (void) setDelegate: (NSFileManager *)delegate {
|
||||
- (void) setDelegate: (id<NSFileManagerDelegate>)delegate {
|
||||
_delegate = delegate;
|
||||
}
|
||||
|
||||
|
@ -1586,6 +1586,26 @@ static NSStringEncoding defaultEncoding;
|
|||
return [self removeItemAtPath: [url path] error: error];
|
||||
}
|
||||
|
||||
- (BOOL) createSymbolicLinkAtPath: (NSString*)path
|
||||
withDestinationPath: (NSString*)destPath
|
||||
error: (NSError**)error
|
||||
{
|
||||
BOOL result;
|
||||
|
||||
DESTROY(_lastError);
|
||||
result = [self createSymbolicLinkAtPath: path pathContent: destPath];
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
if (NO == result)
|
||||
{
|
||||
*error = [self _errorFrom: path to: destPath];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (BOOL) fileExistsAtPath: (NSString*)path
|
||||
{
|
||||
return [self fileExistsAtPath: path isDirectory: 0];
|
||||
|
|
Loading…
Reference in a new issue