Index: src/OFFileManager.h ================================================================== --- src/OFFileManager.h +++ src/OFFileManager.h @@ -55,11 +55,11 @@ * @param path The path to check * @return A boolean whether there is a directory at the specified path */ - (bool)directoryExistsAtPath: (OFString*)path; -#ifdef OF_HAVE_SYMLINK +#if defined(OF_HAVE_SYMLINK) || defined(OF_WINDOWS) /*! * @brief Checks whether a symbolic link exists at the specified path. * * @param path The path to check * @return A boolean whether there is a symbolic link at the specified path Index: src/OFFileManager.m ================================================================== --- src/OFFileManager.m +++ src/OFFileManager.m @@ -222,11 +222,11 @@ return true; return false; } -#ifdef OF_HAVE_SYMLINK +#if defined(OF_HAVE_SYMLINK) - (bool)symbolicLinkExistsAtPath: (OFString*)path { of_stat_t s; if (path == nil) @@ -235,10 +235,24 @@ if (of_lstat(path, &s) == -1) return false; if (S_ISLNK(s.st_mode)) return true; + + return false; +} +#elif defined(OF_WINDOWS) +- (bool)symbolicLinkExistsAtPath: (OFString*)path +{ + WIN32_FIND_DATAW data; + + if (!FindFirstFileW([path UTF16String], &data)) + return false; + + if ((data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) && + data.dwReserved0 == IO_REPARSE_TAG_SYMLINK) + return true; return false; } #endif