return new FileNotFoundException (message,
path);
+ case MonoIOError.ERROR_TOO_MANY_OPEN_FILES:
+ return new IOException ("Too many open files");
+
case MonoIOError.ERROR_PATH_NOT_FOUND:
message = String.Format ("Could not find a part of the path \"{0}\"", path);
return new DirectoryNotFoundException (message);
message = String.Format ("Access to the path \"{0}\" is denied.", path);
return new UnauthorizedAccessException (message);
+ case MonoIOError.ERROR_INVALID_HANDLE:
+ message = String.Format ("Invalid handle to path \"{0}\"", path);
+ return new IOException (message);
+
case MonoIOError.ERROR_FILE_EXISTS:
message = String.Format ("Could not create file \"{0}\". File already exists.", path);
return new IOException (message);
message = String.Format ("Path is too long. Path: {0}", path);
return new PathTooLongException (message);
+ case MonoIOError.ERROR_INVALID_PARAMETER:
+ message = String.Format ("Invalid parameter");
+ return new IOException (message);
+
+ case MonoIOError.ERROR_SHARING_VIOLATION:
+ message = String.Format ("Sharing violation on path {0}", path);
+ return new IOException (message);
+
+ case MonoIOError.ERROR_LOCK_VIOLATION:
+ message = String.Format ("Lock violation on path {0}", path);
+ return new IOException (message);
+
default:
message = String.Format ("Win32 IO returned {0}. Path: {1}", error, path);
return new IOException (message);
result = SetFileTime (handle, creation_time,
last_access_time,
last_write_time, out error);
- Close (handle, out error);
+
+ MonoIOError ignore_error;
+ Close (handle, out ignore_error);
return result;
}