diff options
author | Dick Porter <dick@acm.org> | 2002-10-31 18:55:48 +0300 |
---|---|---|
committer | Dick Porter <dick@acm.org> | 2002-10-31 18:55:48 +0300 |
commit | 542709a35c0cbb8164178de70cddf84748ddfd66 (patch) | |
tree | 78b958418bd8a2666eaa3cde26bd8196722e8a77 /mcs/class/corlib/System.IO/FileInfo.cs | |
parent | ac1b23f5c10bfc1b9f65dd0f4bef3b0447b2535c (diff) |
2002-10-31 Dick Porter <dick@ximian.com>
* FileStream.cs: Fix buffering properly this time. Also kludge
around broken pipe errors, treating them as EOF instead of
throwing an IO exception.
* MonoIO.cs: Return the error status in a parameter, as the
GetLastError() value has long since been blown away if we try and
look it up in a subsequent internal call invocation.
* Process.cs:
* Environment.cs:
* FileSystemInfo.cs:
* FileInfo.cs:
* File.cs:
* Directory.cs: MonoIO methods now have an error parameter
2002-10-31 Dick Porter <dick@ximian.com>
* list.unix: Added MonoIO and MonoIOError to the build
svn path=/trunk/mcs/; revision=8712
Diffstat (limited to 'mcs/class/corlib/System.IO/FileInfo.cs')
-rw-r--r-- | mcs/class/corlib/System.IO/FileInfo.cs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/mcs/class/corlib/System.IO/FileInfo.cs b/mcs/class/corlib/System.IO/FileInfo.cs index 8c73a09c9d6..4cb45ca8a69 100644 --- a/mcs/class/corlib/System.IO/FileInfo.cs +++ b/mcs/class/corlib/System.IO/FileInfo.cs @@ -110,15 +110,21 @@ namespace System.IO { }
// file methods
-
- public override void Delete () {
- if (!MonoIO.Exists (FullPath)) // a weird MS.NET behaviour
- return;
-
- if (!MonoIO.DeleteFile (FullPath))
- throw MonoIO.GetException (OriginalPath);
- }
-
+ + public override void Delete () { + MonoIOError error; + + if (!MonoIO.Exists (FullPath, out error)) { + // a weird MS.NET behaviour + return; + } + + if (!MonoIO.DeleteFile (FullPath, out error)) { + throw MonoIO.GetException (OriginalPath, + error); + } + } + public void MoveTo (string dest) {
File.Move (FullPath, dest);
}
|