mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:26:43 +00:00 
			
		
		
		
	resolve symlinks when searching for file's last modified time.
This commit is contained in:
		
							parent
							
								
									514fba5f73
								
							
						
					
					
						commit
						f6128a85b2
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		|  | @ -883,15 +883,16 @@ void MwIniImporter::setInputEncoding(const ToUTF8::FromType &encoding) | |||
| std::time_t MwIniImporter::lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime) | ||||
| { | ||||
|     std::time_t writeTime(defaultTime); | ||||
|     if (boost::filesystem::exists(filename)) | ||||
|     boost::filesystem::path resolved = boost::filesystem::canonical(filename); | ||||
|     if (boost::filesystem::exists(resolved)) | ||||
|     { | ||||
|         writeTime = boost::filesystem::last_write_time(filename); | ||||
|         std::cout << "content file: " << filename << " timestamp = (" << writeTime  <<  | ||||
|         writeTime = boost::filesystem::last_write_time(resolved); | ||||
|         std::cout << "content file: " << resolved << " timestamp = (" << writeTime << | ||||
|             ") " << asctime(localtime(&writeTime)) << std::endl; | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         std::cout << "content file: " << filename << " not found" << std::endl; | ||||
|         std::cout << "content file: " << resolved << " not found" << std::endl; | ||||
|     } | ||||
|     return writeTime; | ||||
| } | ||||
		Loading…
	
		Reference in a new issue