Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'docs/HtmlAgilityPack/IOLibrary.cs')
-rw-r--r--docs/HtmlAgilityPack/IOLibrary.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/HtmlAgilityPack/IOLibrary.cs b/docs/HtmlAgilityPack/IOLibrary.cs
new file mode 100644
index 00000000000..031040ded9a
--- /dev/null
+++ b/docs/HtmlAgilityPack/IOLibrary.cs
@@ -0,0 +1,28 @@
+// HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
+using System.IO;
+
+namespace HtmlAgilityPack
+{
+ internal struct IOLibrary
+ {
+ #region Internal Methods
+
+ internal static void CopyAlways(string source, string target)
+ {
+ if (!File.Exists(source))
+ return;
+ Directory.CreateDirectory(Path.GetDirectoryName(target));
+ MakeWritable(target);
+ File.Copy(source, target, true);
+ }
+
+ internal static void MakeWritable(string path)
+ {
+ if (!File.Exists(path))
+ return;
+ File.SetAttributes(path, File.GetAttributes(path) & ~FileAttributes.ReadOnly);
+ }
+
+ #endregion
+ }
+} \ No newline at end of file