Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ZipArchive.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ typedef void(^ZipArchiveProgressUpdateBlock)(int percentage, int filesProcessed,

@property (nonatomic, assign) ZipArchiveCompression compression;

/** Do you need to update the file modification time? This operation is a little time-consuming.*/
@property (nonatomic, assign) BOOL needUpdateFileModificationDate;

/**
@brief String encoding to be used when interpreting file names in the zip file.
*/
Expand Down
3 changes: 2 additions & 1 deletion ZipArchive.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ -(id) initWithFileManager:(NSFileManager*) fileManager
_fileManager = fileManager;
self.stringEncoding = NSUTF8StringEncoding;
self.compression = ZipArchiveCompressionDefault;
self.needUpdateFileModificationDate = YES;
}
return self;
}
Expand Down Expand Up @@ -385,7 +386,7 @@ -(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite
[(NSMutableArray*)_unzippedFiles addObject:fullPath];

// set the orignal datetime property
if( fileInfo.tmu_date.tm_year!=0 )
if(self.needUpdateFileModificationDate && fileInfo.tmu_date.tm_year!=0 )
{
NSDateComponents* components = [[NSDateComponents alloc] init];
components.second = fileInfo.tmu_date.tm_sec;
Expand Down