@@ -236,13 +236,13 @@ flags, 0666); # endif if (handle == -1) @throw [OFOpenItemFailedException - exceptionWithPath: path - mode: mode - errNo: errno]; + exceptionWithURL: [OFURL fileURLWithPath: path] + mode: mode + errNo: errno]; #else handle = OFAllocMemory(1, sizeof(*handle)); @try { if ((flags = parseMode(mode.UTF8String, &handle->append)) == -1) @@ -249,10 +249,11 @@ @throw [OFInvalidArgumentException exception]; if ((handle->handle = Open([path cStringWithEncoding: [OFLocale encoding]], flags)) == 0) { int errNo; + OFURL *URL; switch (IoErr()) { case ERROR_OBJECT_IN_USE: case ERROR_DISK_NOT_VALIDATED: errNo = EBUSY; @@ -270,14 +271,15 @@ default: errNo = 0; break; } + URL = [OFURL fileURLWithPath: path]; @throw [OFOpenItemFailedException - exceptionWithPath: path - mode: mode - errNo: errNo]; + exceptionWithURL: URL + mode: mode + errNo: errNo]; } if (handle->append) { # if defined(OF_MORPHOS) if (Seek64(handle->handle, 0, @@ -286,15 +288,17 @@ if (ChangeFilePosition(handle->handle, 0, OFFSET_END) == -1) { # else if (Seek(handle->handle, 0, OFFSET_END) == -1) { # endif + OFURL *URL = + [OFURL fileURLWithPath: path]; Close(handle->handle); @throw [OFOpenItemFailedException - exceptionWithPath: path - mode: mode - errNo: EIO]; + exceptionWithURL: URL + mode: mode + errNo: EIO]; } } Forbid();