id summary reporter owner description type status milestone component version severity resolution keywords cc 9824 boost::filesystem::is_empty() doesn't work with symlinks on Windows michael.burr@… Beman Dawes "See the original information on this problem in this Stackoverflow question: hxxp://stackoverflow.com/questions/22668337/boostfilesystemis-empty-returns-false-for-symlinks The person who reported that problem/asked the question on Stackoverflow also set up a github project that demonstrates the problem: hxxps://github.com/monsdar/BoostSymLinkError Basically, the `filesystem::is_empty()` function doesn't follow a symlink, so it will return false even if the target of the symlink has a length greater than 0. The V2 filesystem library worked for this situation. The difference is that V2 used the `stat()` function in the VC++ library, while the V3 filesystem library uses the Win32 `GetFileAttributesExW()` API. The latter does not follow symlinks and returns a file size of 0 regardless of the size of the symlink target. Attached is a diff for libs/filesystem/src/operations.cpp which uses the `stat()` technique very similar to what was used in filesystem V2. A few differences: - `_wstat()` is used instead of `stat()` to accommodate UNICODE filenames - a bit test using `_S_IFDIR` is used to determine if the path is a directory instead of `S_ISDIR()` because the VC++ library doesn't include a `S_ISDIR()` or `_S_ISDIR()` macro. This patch is only lightly tested (MSVC++ 12.0, 32-bit, on Win7 x64, filenames with ASCII characters only). I'm not sure what the motivations for changing to the `GetFileAttributesExW()` API in filesystem V3 were, so I'm not sure if there's a fundamental flaw in using `_wstat()` that would prevent using it in V3. " Bugs assigned To Be Determined filesystem Boost 1.56.0 Regression