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:
authorGert Driesen <drieseng@users.sourceforge.net>2008-01-23 15:39:43 +0300
committerGert Driesen <drieseng@users.sourceforge.net>2008-01-23 15:39:43 +0300
commit3009758b4d10162667da8920e7d2de0194089ceb (patch)
tree6e4c510d199931bef6f6e44ced2e228e8e9631ae /mcs/class/System/System.Diagnostics/FileVersionInfo.cs
parent654d34f6b5da4787309f05141c5459f2357e3894 (diff)
* FileVersionInfoTest.cs: Added set of (mostly notworking) tests for
FileVersionInfo, and indirectly also for AssemblyBuilder. * FileVersionInfo.cs (GetVersionInfo): Resolve filename to absolute path, and throw FileNotFoundException if it does not exist. * System_test.dll.sources: Added FileVersionInfoTest.cs. svn path=/trunk/mcs/; revision=93643
Diffstat (limited to 'mcs/class/System/System.Diagnostics/FileVersionInfo.cs')
-rw-r--r--mcs/class/System/System.Diagnostics/FileVersionInfo.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs b/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
index cc52a317f4a..96af7f2e64f 100644
--- a/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
+++ b/mcs/class/System/System.Diagnostics/FileVersionInfo.cs
@@ -28,6 +28,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.IO;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
@@ -281,6 +282,11 @@ namespace System.Diagnostics {
new FileIOPermission (FileIOPermissionAccess.Read, fileName).Demand ();
}
#endif
+
+ string absolute = Path.GetFullPath (fileName);
+ if (!File.Exists (absolute))
+ throw new FileNotFoundException (fileName);
+
FileVersionInfo fvi = new FileVersionInfo ();
fvi.GetVersionInfo_internal (fileName);
return fvi;