Skip to content

Commit df0b0d8

Browse files
committed
Still trying to get it to build on Linux.
1 parent c516f7b commit df0b0d8

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

CSFileHandle.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ +(CSFileHandle *)fileHandleForFileURL:(NSURL *)path modes:(NSString *)modes
5151
FILE *fileh=_wfopen((const wchar_t *)[path fileSystemRepresentation],
5252
(const wchar_t *)[modes cStringUsingEncoding:NSUnicodeStringEncoding]);
5353
#else // Cocoa or GNUstep under Linux
54-
FILE *fileh=fopen(path.fileSystemRepresentation,modes.UTF8String);
54+
FILE *fileh=fopen([path fileSystemRepresentation],modes.UTF8String);
5555
#endif
5656

5757
if(!fileh) [[NSException exceptionWithName:CSCannotOpenFileException
5858
reason: [NSString stringWithFormat:@"Error attempting to open file \"%@\" in mode \"%@\" (%d).",path,modes, (int)errno]
59-
userInfo:@{NSUnderlyingErrorKey: [NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil],
60-
NSURLErrorKey: path
61-
}] raise];
59+
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSError errorWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil], NSUnderlyingErrorKey, path, NSURLErrorKey, nil]] raise];
6260

6361
CSFileHandle *handle=[[CSFileHandle alloc] initWithFilePointer:fileh closeOnDealloc:YES path:path.path];
6462
if(handle) return handle;
@@ -89,7 +87,7 @@ +(CSFileHandle *)fileHandleForFileURL:(NSURL *)path modes:(NSString *)modes erro
8987
FILE *fileh=_wfopen((const wchar_t *)[path fileSystemRepresentation],
9088
(const wchar_t *)[modes cStringUsingEncoding:NSUnicodeStringEncoding]);
9189
#else // Cocoa or GNUstep under Linux
92-
FILE *fileh=fopen(path.fileSystemRepresentation,modes.UTF8String);
90+
FILE *fileh=fopen([path fileSystemRepresentation],modes.UTF8String);
9391
#endif
9492

9593
if(!fileh) {

0 commit comments

Comments
 (0)