diff options
| -rw-r--r-- | src/dxfdim.cc | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/src/dxfdim.cc b/src/dxfdim.cc index 66842d2..a241b87 100644 --- a/src/dxfdim.cc +++ b/src/dxfdim.cc @@ -160,9 +160,16 @@ Value builtin_dxf_cross(const Context *ctx, const EvalContext *evalctx)  	}  	std::stringstream keystream; +	fs::path filepath(filename); +	uintmax_t filesize = -1; +	time_t lastwritetime = -1; +	if (fs::exists(filepath) && fs::is_regular_file(filepath)) { +		filesize = fs::file_size(filepath); +		lastwritetime = fs::last_write_time(filepath); +	}  	keystream << filename << "|" << layername << "|" << xorigin << "|" << yorigin -						<< "|" << scale << "|" << fs::last_write_time(filename) -						<< "|" << fs::file_size(filename); +						<< "|" << scale << "|" << lastwritetime +						<< "|" << filesize;  	std::string key = keystream.str();  	if (dxf_cross_cache.find(key) != dxf_cross_cache.end()) | 
