Boost C++ Libraries: Ticket #13369: [Windows] Cannot handle symbolic links https://svn.boost.org/trac10/ticket/13369 <p> I wanted to port my application from Linux to Windows, but shortcut handling is not working. </p> <p> Symlink creation, resolution and detection is not possible on my Windows 10 (Version 1709). </p> <p> Tested with Boost 1.66.0 and 1.64.0. </p> <p> Compiled the Boost Libraries with MSVC (Version 19.10.25019 for x86 and x64). </p> <p> Getting the exception "boost::filesystem::create_symlink: A required privilege is not held by the client" </p> <p> Example: </p> <pre class="wiki">#include &lt;boost/filesystem.hpp&gt; namespace fs = boost::filesystem; int main(){ try{ fs::create_symlink("/path/to_target", "/path/to/link"); } catch(const std::exception&amp; err){ std::cerr &lt;&lt; err.what() &lt;&lt; '\n'; } } </pre><p> Also boost::fileystem::canonical() is not working for me. Tested with extensions ".lnk" and ".url" and without extension, gives me the path to the symbolic link itself (with .lnk), otherwise path not found. </p> <pre class="wiki">int main(){ fs::path path = "/path/to/shortcut"; for(const auto&amp; ext : {"", ".lnk", ".url"}){ try{ std::cout &lt;&lt; fs::canonical(path.string() + ext) &lt;&lt; '\n'; } catch(const std::exception&amp; err){ std::cerr &lt;&lt; err.what() &lt;&lt; '\n'; } } </pre><p> Also symlinks cannot be detected by fs::is_symlink() on my Windows system. </p> <pre class="wiki">int main(){ fs::path path = "/path/to/shortcut"; for(const auto&amp; ext : {"", ".lnk", ".url"}){ auto s = fs::symlink_status(path.string() + ext); std::cout &lt;&lt; (s.type() == fs::file_type::symlink_file) &lt;&lt; ',' &lt;&lt; fs::is_symlink(s) &lt;&lt; '\n'; } } </pre><p> Returns always false. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13369 Trac 1.4.3 emenchen@… Fri, 08 Jun 2018 21:31:31 GMT <link>https://svn.boost.org/trac10/ticket/13369#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13369#comment:1</guid> <description> <p> Shortcuts are not that same as symbolic links. Creating a symbolic link used to require Administrator privileges, although apparently you can do it now if you put the machine in Developer Mode. <a class="ext-link" href="https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/"><span class="icon">​</span>https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/</a> </p> <p> I don't think there is any bug here. </p> </description> <category>Ticket</category> </item> </channel> </rss>