- (NSString *)pithosStateFilePath {
if (!pithosStateFilePath)
- pithosStateFilePath = [[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"PithosLocalObjectStates.archive"] retain];
+ pithosStateFilePath = [[[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
+ stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]
+ stringByAppendingPathComponent:@"PithosLocalObjectStates.archive"] retain];
return [[pithosStateFilePath copy] autorelease];
}
[fileManager createDirectoryAtPath:tempDownloadsDirPath withIntermediateDirectories:YES attributes:nil error:&error];
if (error)
tempDownloadsDirPath = nil;
- }
+ }
if (!tempDownloadsDirPath) {
- NSString *tempDirTemplate = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Temp Downloads XXXXXX"];
+ NSString *tempDirTemplate = [[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
+ stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]
+ stringByAppendingPathComponent:@"Temp Downloads XXXXXX"];
const char *tempDirTemplateCString = [tempDirTemplate fileSystemRepresentation];
char *tempDirNameCString = (char *)malloc(strlen(tempDirTemplateCString) + 1);
strcpy(tempDirNameCString, tempDirTemplateCString);
tempTrashDirPath = nil;
}
if (!tempTrashDirPath) {
- NSString *tempDirTemplate = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Temp Trash XXXXXX"];
+ NSString *tempDirTemplate = [[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]
+ stringByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]]
+ stringByAppendingPathComponent:@"Temp Trash XXXXXX"];
const char *tempDirTemplateCString = [tempDirTemplate fileSystemRepresentation];
char *tempDirNameCString = (char *)malloc(strlen(tempDirTemplateCString) + 1);
strcpy(tempDirNameCString, tempDirTemplateCString);