58 CacheEntry* entryref = Cache::GetInstance()->GetEntryList(OriginalFilename); |
58 CacheEntry* entryref = Cache::GetInstance()->GetEntryList(OriginalFilename); |
59 if(! entryref) |
59 if(! entryref) |
60 { |
60 { |
61 return (CacheEntry*)0; |
61 return (CacheEntry*)0; |
62 } |
62 } |
|
63 |
|
64 boost::filesystem::path originalfile(OriginalFilename); |
|
65 time_t originalcreationtime = last_write_time(originalfile); |
|
66 string creationtime(ctime(&originalcreationtime)); |
|
67 size_t newlinepos = creationtime.find("\n"); |
|
68 while(newlinepos != string::npos) |
|
69 { |
|
70 creationtime.erase(newlinepos, 1); |
|
71 newlinepos = creationtime.find(("\n")); |
|
72 } |
63 while(entryref) |
73 while(entryref) |
64 { |
74 { |
65 boost::filesystem::path originalfile(OriginalFilename); |
75 if((creationtime.compare(entryref->GetOriginalFileCreateTime())== 0) && (atoi(entryref->GetCachedFileCompressionID())==CurrentCompressionID)) |
66 time_t originalcreationtime = last_write_time(originalfile); |
|
67 string creationtime(ctime(&originalcreationtime)); |
|
68 size_t newlinepos = creationtime.find("\n"); |
|
69 while(newlinepos != string::npos) |
|
70 { |
|
71 creationtime.erase(newlinepos, 1); |
|
72 newlinepos = creationtime.find(("\n")); |
|
73 } |
|
74 if((creationtime.compare(entryref->GetOriginalFileCreateTime())== 0) || (atoi(entryref->GetCachedFileCompressionID())==CurrentCompressionID)) |
|
75 { |
76 { |
76 boost::filesystem::path cachedfile(entryref->GetCachedFilename()); |
77 boost::filesystem::path cachedfile(entryref->GetCachedFilename()); |
77 string filename = cachedfile.file_string(); |
78 string filename = cachedfile.file_string(); |
78 ifstream filecontentreader(filename.c_str(), ios_base::in | ios_base::binary); |
79 ifstream filecontentreader(filename.c_str(), ios_base::in | ios_base::binary); |
79 if(! filecontentreader.is_open()){ |
80 if(! filecontentreader.is_open()){ |