Index: src/OFFileManager.h ================================================================== --- src/OFFileManager.h +++ src/OFFileManager.h @@ -481,25 +481,25 @@ * @param source The path to the item for which a link should be created * @param destination The path to the item which should link to the source */ - (void)linkItemAtPath: (OFString *)source toPath: (OFString *)destination; +#endif /*! * @brief Creates a hard link for the specified item. * * The destination URL must have a full path, which means it must include the * name of the item. * - * This method is not available on some systems. + * This method is not available for all URLs. * * @param source The URL to the item for which a link should be created * @param destination The URL to the item which should link to the source */ - (void)linkItemAtURL: (OFURL *)source toURL: (OFURL *)destination; -#endif #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS /*! * @brief Creates a symbolic link for an item. * @@ -516,18 +516,19 @@ * @param source The path to the item for which a symbolic link should be * created */ - (void)createSymbolicLinkAtPath: (OFString *)destination withDestinationPath: (OFString *)source; +#endif /*! * @brief Creates a symbolic link for an item. * * The destination uRL must have a full path, which means it must include the * name of the item. * - * This method is not available on some systems. + * This method is not available for all URLs. * * @note On Windows, this requires at least Windows Vista and administrator * privileges! * * @param destination The URL to the item which should symbolically link to the @@ -535,11 +536,10 @@ * @param source The URL to the item for which a symbolic link should be * created */ - (void)createSymbolicLinkAtURL: (OFURL *)destination withDestinationURL: (OFURL *)source; -#endif @end @interface OFDictionary (FileAttributes) /*! * The @ref of_file_attribute_key_size key from the dictionary. Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -1568,22 +1568,27 @@ # endif objc_autoreleasePoolPop(pool); } +#endif - (void)linkItemAtURL: (OFURL *)source toURL: (OFURL *)destination { +#ifdef OF_FILE_MANAGER_SUPPORTS_LINKS void *pool = objc_autoreleasePoolPush(); [self linkItemAtPath: [source fileSystemRepresentation] toPath: [destination fileSystemRepresentation]]; objc_autoreleasePoolPop(pool); -} +#else + @throw [OFNotImplementedException exceptionWithSelector: _cmd + object: self]; #endif +} #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS - (void)createSymbolicLinkAtPath: (OFString *)destination withDestinationPath: (OFString *)source { @@ -1616,22 +1621,27 @@ errNo: 0]; # endif objc_autoreleasePoolPop(pool); } +#endif - (void)createSymbolicLinkAtURL: (OFURL *)destination withDestinationURL: (OFURL *)source { +#ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS void *pool = objc_autoreleasePoolPush(); [self createSymbolicLinkAtPath: [destination fileSystemRepresentation] withDestinationPath: [source fileSystemRepresentation]]; objc_autoreleasePoolPop(pool); -} +#else + @throw [OFNotImplementedException exceptionWithSelector: _cmd + object: self]; #endif +} @end @implementation OFDictionary (FileAttributes) - (uintmax_t)fileSize {