mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 02:01:03 +00:00
Cache the file manager when getting the file system representation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9652 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0e86498f2d
commit
2ee10362f1
1 changed files with 8 additions and 1 deletions
|
@ -2361,7 +2361,14 @@ handle_printf_atsign (FILE *stream,
|
||||||
/* Return a string for passing to OS calls to handle file system objects. */
|
/* Return a string for passing to OS calls to handle file system objects. */
|
||||||
- (const char*) fileSystemRepresentation
|
- (const char*) fileSystemRepresentation
|
||||||
{
|
{
|
||||||
return [[NSFileManager defaultManager] fileSystemRepresentationWithPath: self];
|
static NSFileManager *fm = nil;
|
||||||
|
|
||||||
|
if (fm == nil)
|
||||||
|
{
|
||||||
|
fm = [NSFileManager defaultManager];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [fm fileSystemRepresentationWithPath: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) getFileSystemRepresentation: (char*)buffer maxLength: (unsigned)size
|
- (BOOL) getFileSystemRepresentation: (char*)buffer maxLength: (unsigned)size
|
||||||
|
|
Loading…
Reference in a new issue