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:
nico 2001-04-21 18:12:06 +00:00
parent 0e86498f2d
commit 2ee10362f1

View file

@ -2361,7 +2361,14 @@ handle_printf_atsign (FILE *stream,
/* Return a string for passing to OS calls to handle file system objects. */
- (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