public static function saveToFile($file, $properties) {
        $prop_string = self::saveToString($properties);

        $real_file = File::asFile($file);

        if (!$real_file->exists()) {
            $real_file->touch();
        }
        $real_file->setContent($prop_string);
    }