Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -226,10 +226,13 @@ + (void)removeItemAtPath: (OFString*)path; #ifdef OF_HAVE_LINK /*! * @brief Creates a hard link for the specified item. + * + * The destination path must be a full path, which means it must include the + * name of the item. * * This method is not available on some systems, most notably Windows. * * @param source The path of the item for which a link should be created * @param destination The path of the item which should link to the source @@ -239,10 +242,13 @@ #endif #ifdef OF_HAVE_SYMLINK /*! * @brief Creates a symbolic link for an item. + * + * The destination path must be a full path, which means it must include the + * name of the item. * * This method is not available on some systems, most notably Windows. * * @param destination The path of the item which should symbolically link to the * source Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -755,16 +755,10 @@ if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); - if ([self directoryExistsAtPath: destination]) { - OFArray *components = [OFArray arrayWithObjects: - destination, [source lastPathComponent], nil]; - destination = [OFString pathWithComponents: components]; - } - if (link([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]) != 0) @throw [OFLinkFailedException exceptionWithSourcePath: source destinationPath: destination]; @@ -782,16 +776,10 @@ if (source == nil || destination == nil) @throw [OFInvalidArgumentException exception]; pool = objc_autoreleasePoolPush(); - if ([self directoryExistsAtPath: destination]) { - OFArray *components = [OFArray arrayWithObjects: - destination, [source lastPathComponent], nil]; - destination = [OFString pathWithComponents: components]; - } - if (symlink([source cStringWithEncoding: OF_STRING_ENCODING_NATIVE], [destination cStringWithEncoding: OF_STRING_ENCODING_NATIVE]) != 0) @throw [OFCreateSymbolicLinkFailedException exceptionWithSourcePath: source destinationPath: destination];