aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-21 23:01:35 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-21 23:01:35 +0000
commitf3135b07cefa7a870fbad85de8abb8eae5f4645e (patch)
treefa474f5e0e6130d0983dc6a5d74febb0412c5d83
parent75c1cf6b0a918752c1a6a439e96e5cf8fba7e5ea (diff)
downloadsequelpro-f3135b07cefa7a870fbad85de8abb8eae5f4645e.tar.gz
sequelpro-f3135b07cefa7a870fbad85de8abb8eae5f4645e.tar.bz2
sequelpro-f3135b07cefa7a870fbad85de8abb8eae5f4645e.zip
• this commit should fix the displaying the correct read file size and the file size while importing very large CSV/SQL
- replaced deprecated method fileAttributesAtPath:traverseLink: by attributesOfItemAtPath:error: - fix for i549
-rw-r--r--Source/TableDump.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 46bb10d2..5385a053 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -535,8 +535,8 @@
NSString *query;
NSMutableString *errors = [NSMutableString string];
NSInteger fileChunkMaxLength = 1024 * 1024;
- NSInteger fileTotalLength = 0;
- NSInteger fileProcessedLength = 0;
+ NSUInteger fileTotalLength = 0;
+ NSUInteger fileProcessedLength = 0;
NSInteger queriesPerformed = 0;
NSInteger dataBufferLength = 0;
NSInteger dataBufferPosition = 0;
@@ -560,7 +560,7 @@
}
// Grab the file length
- fileTotalLength = [[[[NSFileManager defaultManager] fileAttributesAtPath:filename traverseLink:YES] objectForKey:NSFileSize] integerValue];
+ fileTotalLength = [[[[NSFileManager defaultManager] attributesOfItemAtPath:filename error:NULL] objectForKey:NSFileSize] longLongValue];
if (!fileTotalLength) fileTotalLength = 1;
// Reset progress interface
@@ -771,8 +771,8 @@
NSArray *csvRowArray;
NSInteger fileChunkMaxLength = 256 * 1024;
NSInteger csvRowsPerQuery = 50;
- NSInteger csvRowsThisQuery;
- NSInteger fileTotalLength = 0;
+ NSUInteger csvRowsThisQuery;
+ NSUInteger fileTotalLength = 0;
NSInteger rowsImported = 0;
NSInteger dataBufferLength = 0;
NSInteger dataBufferPosition = 0;
@@ -798,7 +798,7 @@
}
// Grab the file length
- fileTotalLength = [[[[NSFileManager defaultManager] fileAttributesAtPath:filename traverseLink:YES] objectForKey:NSFileSize] integerValue];
+ fileTotalLength = [[[[NSFileManager defaultManager] attributesOfItemAtPath:filename error:NULL] objectForKey:NSFileSize] longLongValue];
if (!fileTotalLength) fileTotalLength = 1;
// Reset progress interface