Adium

Changeset 24054

Show
Ignore:
Timestamp:
06/24/2008 07:53:16 AM (7 months ago)
Author:
evands
Message:

If we fail to read a preferences file, log information about the file (including file size and modification date) and reattempt the read until it succeeds (if the file actually exists). This may cause a permanent beachball when #9804 happens... or may fix it. We shall see. Refs #9804

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/AIPreferenceContainer.m

    r24034 r24054  
    243243                                        AILogWithSignature(@"Error reading data for preferences file %@: %@ (%@ %i: %@)", objectPrefsPath, error, 
    244244                                                                           [error domain], [error code], [error userInfo]); 
     245                                        if ([[NSFileManager defaultManager] fileExistsAtPath:objectPrefsPath]) { 
     246                                                while (!data) { 
     247                                                        AILogWithSignature(@"Preferences file %@'s attributes: %@. Reattempting to read the file...", globalPrefsName, [[NSFileManager defaultManager] fileAttributesAtPath:objectPrefsPath traverseLink:NO]); 
     248                                                        data = [NSData dataWithContentsOfFile:objectPrefsPath 
     249                                                                                                                  options:NSUncachedRead 
     250                                                                                                                        error:&error]; 
     251                                                        if (error) { 
     252                                                                AILogWithSignature(@"Error reading data for preferences file %@: %@ (%@ %i: %@)", objectPrefsPath, error, 
     253                                                                                                   [error domain], [error code], [error userInfo]); 
     254                                                        }        
     255                                                } 
     256                                        } 
    245257                                } 
    246258