<commit_before>// +build !windows

package local

import (
	"os"
	"restic/fs"
)

// set file to readonly
func setNewFileMode(f string, fi os.FileInfo) error {
	return fs.Chmod(f, fi.Mode()&os.FileMode(^uint32(0222)))
}<commit_msg>local: Ignore ENOTSUP error for chmod<commit_after>// +build !windows

package local

import (
	"os"
	"restic/fs"
	"syscall"
)

// set file to readonly
func setNewFileMode(f string, fi os.FileInfo) error {
	err := fs.Chmod(f, fi.Mode()&os.FileMode(^uint32(0222)))
	// ignore the error if the FS does not support setting this mode (e.g. CIFS with gvfs on Linux)
	if err == syscall.ENOTSUP {
		err = nil
	}
	return err
}
{'fraction_non_alphanumeric': 0.13734567901234568, 'fraction_numerical': 0.018518518518518517, 'mean_word_length': 3.9923076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3615552', 'n_tokens_mistral': 262, 'n_tokens_neox': 250, 'n_words': 73}