@@ -80,10 +80,11 @@ #import "OFOpenItemFailedException.h" #import "OFOutOfMemoryException.h" #import "OFOutOfRangeException.h" #import "OFReadFailedException.h" #import "OFRemoveItemFailedException.h" +#import "OFStatItemFailedException.h" #import "OFSeekFailedException.h" #import "OFUnlockFailedException.h" #import "OFWriteFailedException.h" #ifdef _WIN32 @@ -521,12 +522,11 @@ if (path == nil) @throw [OFInvalidArgumentException exception]; if (of_stat(path, &s) != 0) - /* FIXME: Maybe use another exception? */ - @throw [OFOpenItemFailedException exceptionWithPath: path + @throw [OFStatItemFailedException exceptionWithPath: path errNo: errno]; return s.st_size; } @@ -536,12 +536,11 @@ if (path == nil) @throw [OFInvalidArgumentException exception]; if (of_stat(path, &s) != 0) - /* FIXME: Maybe use another exception? */ - @throw [OFOpenItemFailedException exceptionWithPath: path + @throw [OFStatItemFailedException exceptionWithPath: path errNo: errno]; /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_atime]; } @@ -552,12 +551,11 @@ if (path == nil) @throw [OFInvalidArgumentException exception]; if (of_stat(path, &s) != 0) - /* FIXME: Maybe use another exception? */ - @throw [OFOpenItemFailedException exceptionWithPath: path + @throw [OFStatItemFailedException exceptionWithPath: path errNo: errno]; /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_mtime]; } @@ -568,12 +566,11 @@ if (path == nil) @throw [OFInvalidArgumentException exception]; if (of_stat(path, &s) != 0) - /* FIXME: Maybe use another exception? */ - @throw [OFOpenItemFailedException exceptionWithPath: path + @throw [OFStatItemFailedException exceptionWithPath: path errNo: errno]; /* FIXME: We could be more precise on some OSes */ return [OFDate dateWithTimeIntervalSince1970: s.st_ctime]; } @@ -986,12 +983,11 @@ encoding = [OFSystemInfo native8BitEncoding]; length = readlink([path cStringWithEncoding: encoding], destination, PATH_MAX); if (length < 0) - /* FIXME: Maybe use another exception? */ - @throw [OFOpenItemFailedException exceptionWithPath: path + @throw [OFStatItemFailedException exceptionWithPath: path errNo: errno]; return [OFString stringWithCString: destination encoding: encoding length: length];