@@ -48,10 +48,23 @@ relativeToURL: (OFURL*)URL { return [[[self alloc] initWithString: string relativeToURL: URL] autorelease]; } + ++ (instancetype)fileURLWithPath: (OFString*)path +{ + OFURL *URL = [OFURL URL]; + void *pool = objc_autoreleasePoolPush(); + + [URL setScheme: @"file"]; + [URL setPath: [[path pathComponents] componentsJoinedByString: @"/"]]; + + objc_autoreleasePoolPop(pool); + + return URL; +} - initWithString: (OFString*)string { char *UTF8String, *UTF8String2 = NULL;