@@ -14,24 +14,24 @@ * file. */ #include "config.h" +#include +#include #include #include #include -#include #include #import "OFString.h" #import "OFString_UTF8.h" #import "OFString_UTF8+Private.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFDataArray.h" -#import "OFSystemInfo.h" #ifdef OF_HAVE_FILES # import "OFFile.h" #endif #import "OFURL.h" #ifdef OF_HAVE_SOCKETS @@ -819,23 +819,23 @@ - initWithContentsOfFile: (OFString*)path encoding: (of_string_encoding_t)encoding { char *tmp; - struct stat st; + of_stat_t st; @try { OFFile *file; /* Make sure the file system is initialized */ [OFFile class]; - if (stat([path cStringWithEncoding: - [OFSystemInfo native8BitEncoding]], &st) == -1) + if (of_stat(path, &st) != 0) @throw [OFOpenFileFailedException exceptionWithPath: path - mode: @"rb"]; + mode: @"rb" + errNo: errno]; if (st.st_size > SIZE_MAX) @throw [OFOutOfRangeException exception]; file = [[OFFile alloc] initWithPath: path