public static function getAndModify(FileSystemCacheKey $key, \Closure $callback, $resetTtl=false) {
		$filename = $key->getFileName();
		
		if(!file_exists($filename)) return false;

		//open a file handle
		$fh = self::getFileHandle($filename,'c+');
		if(!$fh) return false;
		
		//get the data
		$data = self::getContents($fh,$key);
		if(!$data) return false;
		
		//get new value from callback function
		$old_value = $data->value;
		$data->value = $callback($data->value);
		
		//if the callback function returns false
		if($data->value === false) {
			self::closeFile($fh);

			//delete the cache file
			self::invalidate($key);
			return false;
		}
		
		//if value didn't change
		if(!$resetTtl && $data->value === $old_value) {
			self::closeFile($fh);			
			return $data->value;
		}
		
		//if we're resetting the ttl to now
		if($resetTtl) {
			$data->created = time();
			if($data->ttl) {
				$data->expires = $data->created + $data->ttl;
			}
		}

		if(!self::emptyFile($fh)) return false;

		//write contents and close the file handle
		self::putContents($fh,$data);
		
		//return the new value after modifying
		return $data->value;
	}