Inherits from NSObject
Declared in DDFileLogger.h

Overview

DDLogFileInfo is a simple class that provides access to various file attributes. It provides good performance as it only fetches the information if requested, and it caches the information to prevent duplicate fetches.

It was designed to provide quick snapshots of the current state of log files, and to help sort log files in an array.

This class does not monitor the files, or update it’s cached attribute values if the file changes on disk. This is not what the class was designed for.

If you absolutely must get updated values, you can invoke the reset method which will clear the cache.

Properties

age

@property (nonatomic, readonly) NSTimeInterval age

creationDate

@property (strong, nonatomic, readonly) NSDate *creationDate

fileAttributes

@property (strong, nonatomic, readonly) NSDictionary *fileAttributes

fileName

@property (strong, nonatomic, readonly) NSString *fileName

filePath

@property (strong, nonatomic, readonly) NSString *filePath

fileSize

@property (nonatomic, readonly) unsigned long long fileSize

isArchived

@property (nonatomic, readwrite) BOOL isArchived

modificationDate

@property (strong, nonatomic, readonly) NSDate *modificationDate

Class Methods

logFileWithPath:

+ (instancetype)logFileWithPath:(NSString *)filePath

Instance Methods

addExtendedAttributeWithName:

- (void)addExtendedAttributeWithName:(NSString *)attrName

addExtensionAttributeWithName:

- (void)addExtensionAttributeWithName:(NSString *)attrName

hasExtendedAttributeWithName:

- (BOOL)hasExtendedAttributeWithName:(NSString *)attrName

hasExtensionAttributeWithName:

- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName

initWithFilePath:

- (instancetype)initWithFilePath:(NSString *)filePath

removeExtendedAttributeWithName:

- (void)removeExtendedAttributeWithName:(NSString *)attrName

removeExtensionAttributeWithName:

- (void)removeExtensionAttributeWithName:(NSString *)attrName

renameFile:

- (void)renameFile:(NSString *)newFileName

reset

- (void)reset

reverseCompareByCreationDate:

- (NSComparisonResult)reverseCompareByCreationDate:(DDLogFileInfo *)another

reverseCompareByModificationDate:

- (NSComparisonResult)reverseCompareByModificationDate:(DDLogFileInfo *)another