You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when executing boost::filesystem::file_size on a symbolic link on Windows the functions returns a size of 0. The same call on Linux returns the size of the file the symbolic link is pointing to. I'm unsure what the correct outcome should be but I would vote for the Linux version.
I used boost version 1.85.0 on both systems.
Here the code of a simple command line tool to reproduce the problem:
GetFileAttributesExW that was used to implement file_size and is_empty
on Windows returns information about the symlink rather than the file
the symlink refers to. Fix this by opening the file and using
GetFileInformationByHandle to obtain the file size and attributes.
Additionally, reworked is_empty implementation to reuse the file handle
(and fd on POSIX systems) to create the directory iterator if the
operation is invoked on a directory. On POSIX systems, implement a
more lightweight version of is_empty_directory when readdir is safe
to use. Reusing the file handle/fd improves protection against
filesystem races, when the file that is being tested by is_empty
is initially a directory and then, when we create a directory
iterator, it is not.
Fixes#313.
Hello,
when executing boost::filesystem::file_size on a symbolic link on Windows the functions returns a size of 0. The same call on Linux returns the size of the file the symbolic link is pointing to. I'm unsure what the correct outcome should be but I would vote for the Linux version.
I used boost version 1.85.0 on both systems.
Here the code of a simple command line tool to reproduce the problem:
Kind regards,
Torsten Hauska
The text was updated successfully, but these errors were encountered: