{"id":3597,"date":"2016-02-25T20:19:08","date_gmt":"2016-02-25T20:19:08","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=3597"},"modified":"2016-02-25T20:19:08","modified_gmt":"2016-02-25T20:19:08","slug":"symlinksjunctions-in-windows","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/symlinksjunctions-in-windows\/","title":{"rendered":"Symlinks\/Junctions in Windows"},"content":{"rendered":"<p>I&#8217;m not sure which version of Windows these became available in, but a useful feature (as per *nix) is the capability of creating a link from one folder to another.<\/p>\n<p>So for example, I have source code which relies on a set of libraries which are supplied in a zip (i.e. no NuGet or other packaging\/versioning). So I tend to create a folder with the version number in it to make it easy to immediately see what version I&#8217;m using.<\/p>\n<p>Great, but the problem with this approach is I also have tooling which automatically deploys these files and post build events which do similar things. Updating these every time I get a new version is repetitive and easy to make a mistake. Plus, I&#8217;m basically lazy, if I do something once I don&#8217;t want to do it again.<\/p>\n<p>So it would be far better if we created a symbolic link to the newly downloaded zips\/files with a name that all the tooling can expect, for example I&#8217;ll instead create a symlink named Latest which points to the actual version (this also means I could switch version if I want easily).<\/p>\n<p>To create such a link we simply use<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nmklink \/J Latest MyLibsv1.234\r\n<\/pre>\n<p>this command will create a junction (or symlink) named Latest and the folder it links to is MyLibsv1.234<\/p>\n<p>Now we might use nant a batch file or some other means to do this for us, but when the link&#8217;s created you cannot update it (or so it seems), instead you need to delete it using<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\nrd Latest\r\n<\/pre>\n<p>So now our post build events and\/or other tooling can just refer to the folder Latest and everything works smoothly. <\/p>\n<p>When it&#8217;s time to deploy MyLibsv2.0 we just delete the junction and create it again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m not sure which version of Windows these became available in, but a useful feature (as per *nix) is the capability of creating a link from one folder to another. So for example, I have source code which relies on a set of libraries which are supplied in a zip (i.e. no NuGet or other [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[53],"tags":[],"class_list":["post-3597","post","type-post","status-publish","format-standard","hentry","category-windows"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=3597"}],"version-history":[{"count":4,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3597\/revisions"}],"predecessor-version":[{"id":3622,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3597\/revisions\/3622"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=3597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=3597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=3597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}