Boost C++ Libraries: Ticket #9016: filesystem::is_directory() returns false for junction https://svn.boost.org/trac10/ticket/9016 <p> On Windows 7, create a Junction (to another folder). </p> <p> You can use the "hardlink shell ext" tool to make the junctions/symlinks (google for it): Or the usual command line tools. </p> <p> The boost::is_directory(target) returns false on this junction. </p> <p> I used this Junction technique to move c:\Users\Me\<a class="missing wiki">AppData</a>\Local\Temp to another disk, and as a consequence, temp_directory_path() will always fail because that host path is not treated as a directory. </p> <p> ie the line in temp_directory_path(): </p> <pre class="wiki"> if ((ec&amp;&amp;!is_directory(p, *ec))||(!ec&amp;&amp;!is_directory(p))) </pre><p> cheers, Paul </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9016 Trac 1.4.3 Joseph Southwell <joseph@…> Thu, 24 Jul 2014 22:58:11 GMT <link>https://svn.boost.org/trac10/ticket/9016#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9016#comment:1</guid> <description> <p> Upvote! Junctions are by definition directories on windows. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Fri, 25 Jul 2014 19:57:21 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/9016#comment:2 https://svn.boost.org/trac10/ticket/9016#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> The real question is whether or not it is safe to treat a Windows <a class="missing wiki">ReparseTag</a> of either IO_REPARSE_TAG_SYMLINK or IO_REPARSE_TAG_MOUNT_POINT as a symlink for purposes of Boost.Filesystem. IO_REPARSE_TAG_MOUNT_POINT is the tag assigned by mklink /j to indicate a directory junction. </p> <p> That appears to work OK, but (1) I'm worried about unintended consequences, and (2) it is too late for this change to go into Boost 1.56.0. So it is now in develop, and a 1.56.1 release of Boost.Filesystem will to into master as soon Boost 1.56.0 ships. That will give early adopters a chance to kick the tires and report any problems encountered before 1.57.0 ships. </p> <p> Thanks, </p> <p> --Beman </p> <p> </p> Ticket stsoe <stsoe@…> Sat, 26 Dec 2015 05:01:00 GMT <link>https://svn.boost.org/trac10/ticket/9016#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9016#comment:3</guid> <description> <p> I just upgraded to boost_1_60_0 and was hit by a regression I think is related to 9016. My windows tests are failing sporadically with the error: </p> <pre class="wiki">boost::filesystem::read_symlink: The process cannot access the file because it is being used by another process: "r:/data" </pre><p> Debugging this comparing 1_60_0 to the earlier 1_56_0 I finally narrowed the difference to <code>operations.cpp: bool is_reparse_point_a_symlink</code>, which returns true in 1_60_0 but false in 1_56_0. The return value triggers <code>canonical</code> to call detail::read_symlink, which in turn ends up calling ::CreateFileW with dwShareMode set to 0 so that the file/directory is locked and cannot be opened by another process. </p> <p> I am running my tests on LSF and many many processes end up accessing the same file / directory at the same time, thus leading the the above error message. </p> <p> This problem unfortunately is a huge problem for the code I am working on, so I am wondering if I can get the 1_56_0 behavior by reverting the changes to <code>is_reparse_point_a symlink</code>? </p> </description> <category>Ticket</category> </item> <item> <author>martin.apel@…</author> <pubDate>Fri, 04 Aug 2017 14:59:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9016#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9016#comment:4</guid> <description> <p> The implementation as of 1.64 (which is the same as for 1.60) still has a bug related to handling reparse points: </p> <blockquote> <p> For an input path, which points to a IO_REPARSE_TAG_MOUNT_POINT, it returns something like </p> <blockquote> <p> E:/?\Volume{3bb57579-710b-11e7-ac12-e8b1fc0f674c}\ \test </p> </blockquote> <p> which is not accepted by other filesystem function, e.g. by create_directories. </p> </blockquote> <p> From my point of view it is wrong to treat mount points as symlinks in all cases. </p> </description> <category>Ticket</category> </item> </channel> </rss>