<commit_before>﻿/*
 * Authors:
 *   钟峰(<NAME>) <<EMAIL>>
 *
 * Copyright (C) 2010-2014 Zongsoft Corporation <http://www.zongsoft.com>
 *
 * This file is part of Zongsoft.CoreLibrary.
 *
 * Zongsoft.CoreLibrary is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * Zongsoft.CoreLibrary is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with Zongsoft.CoreLibrary; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

using System;
using System.IO;
using System.Collections.Generic;

namespace Zongsoft.IO
{
	/// <summary>
	/// 提供用于创建、复制、删除、移动和打开文件等功能的抽象接口，该接口将提供不同文件系统的文件支持。
	/// </summary>
	public interface IFile
	{
		/// <summary>
		/// 获取指定文件路径对应的<see cref="FileInfo"/>。
		/// </summary>
		/// <param name="path">指定的文件路径。</param>
		/// <returns>如果指定的路径是存在的则返回对应的<see cref="FileInfo"/>，否则返回空(null)。</returns>
		FileInfo GetInfo(string path);

		bool Delete(string path);
		bool Exists(string path);

		void Copy(string source, string destination);
		void Copy(string source, string destination, bool overwrite);

		void Move(string source, string destination);

		Stream Open(string path);
		Stream Open(string path, FileMode mode);
		Stream Open(string path, FileMode mode, FileAccess access);
		Stream Open(string path, FileMode mode, FileAccess access, FileShare share);
	}
}<commit_msg>为 Open(...) 方法增加一个名为 properties 的可选参数。<commit_after>﻿/*
 * Authors:
 *   钟峰(<NAME>) <<EMAIL>>
 *
 * Copyright (C) 2010-2014 Zongsoft Corporation <http://www.zongsoft.com>
 *
 * This file is part of Zongsoft.CoreLibrary.
 *
 * Zongsoft.CoreLibrary is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * Zongsoft.CoreLibrary is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with Zongsoft.CoreLibrary; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

using System;
using System.IO;
using System.Collections.Generic;

namespace Zongsoft.IO
{
	/// <summary>
	/// 提供用于创建、复制、删除、移动和打开文件等功能的抽象接口，该接口将提供不同文件系统的文件支持。
	/// </summary>
	public interface IFile
	{
		/// <summary>
		/// 获取指定文件路径对应的<see cref="FileInfo"/>。
		/// </summary>
		/// <param name="path">指定的文件路径。</param>
		/// <returns>如果指定的路径是存在的则返回对应的<see cref="FileInfo"/>，否则返回空(null)。</returns>
		FileInfo GetInfo(string path);

		bool Delete(string path);
		bool Exists(string path);

		void Copy(string source, string destination);
		void Copy(string source, string destination, bool overwrite);

		void Move(string source, string destination);

		Stream Open(string path, IDictionary<string, string> properties = null);
		Stream Open(string path, FileMode mode, IDictionary<string, string> properties = null);
		Stream Open(string path, FileMode mode, FileAccess access, IDictionary<string, string> properties = null);
		Stream Open(string path, FileMode mode, FileAccess access, FileShare share, IDictionary<string, string> properties = null);
	}
}
{'fraction_non_alphanumeric': 0.1018585566014965, 'fraction_numerical': 0.010137581462708182, 'mean_word_length': 4.285714285714286, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2830464', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1290, 'n_words': 462}