Restructure of mono.sln and build properties to better fix static/dynamic library...
[mono.git] / docs / HtmlAgilityPack / IOLibrary.cs
1 // HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>\r
2 using System.IO;\r
3 \r
4 namespace HtmlAgilityPack\r
5 {\r
6     internal struct IOLibrary\r
7     {\r
8         #region Internal Methods\r
9 \r
10         internal static void CopyAlways(string source, string target)\r
11         {\r
12             if (!File.Exists(source))\r
13                 return;\r
14             Directory.CreateDirectory(Path.GetDirectoryName(target));\r
15             MakeWritable(target);\r
16             File.Copy(source, target, true);\r
17         }\r
18 \r
19         internal static void MakeWritable(string path)\r
20         {\r
21             if (!File.Exists(path))\r
22                 return;\r
23             File.SetAttributes(path, File.GetAttributes(path) & ~FileAttributes.ReadOnly);\r
24         }\r
25 \r
26         #endregion\r
27     }\r
28 }