<commit_before>#ifndef SILICIUM_WIN32_OPEN_HPP
#define SILICIUM_WIN32_OPEN_HPP

#include <silicium/error_or.hpp>
#include <silicium/file_descriptor.hpp>
#include <boost/filesystem/path.hpp>

namespace Si
{
	inline error_or<file_descriptor> open_reading(boost::filesystem::path const &name)
	{
		native_file_handle const fd = ::CreateFileW(name.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_ALWAYS, 0, NULL);
		if (fd == INVALID_HANDLE_VALUE)
		{
			return boost::system::error_code(GetLastError(), boost::system::system_category());
		}
		return file_descriptor(fd);
	}
}

#endif<commit_msg>implement create_file for Win32<commit_after>#ifndef SILICIUM_WIN32_OPEN_HPP
#define SILICIUM_WIN32_OPEN_HPP

#include <silicium/error_or.hpp>
#include <silicium/file_descriptor.hpp>
#include <boost/filesystem/path.hpp>

namespace Si
{
	inline error_or<file_descriptor> open_reading(boost::filesystem::path const &name)
	{
		native_file_handle const fd = ::CreateFileW(name.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_ALWAYS, 0, NULL);
		if (fd == INVALID_HANDLE_VALUE)
		{
			return boost::system::error_code(GetLastError(), boost::system::system_category());
		}
		return file_descriptor(fd);
	}

	inline error_or<file_descriptor> create_file(boost::filesystem::path const &name)
	{
		native_file_handle const fd = ::CreateFileW(name.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, CREATE_NEW, 0, NULL);
		if (fd == INVALID_HANDLE_VALUE)
		{
			return boost::system::error_code(GetLastError(), boost::system::system_category());
		}
		return file_descriptor(fd);
	}
}

#endif
{'fraction_non_alphanumeric': 0.12649465072372562, 'fraction_numerical': 0.008181246066708621, 'mean_word_length': 7.324607329842932, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '82633', 'n_tokens_mistral': 611, 'n_tokens_neox': 567, 'n_words': 97}