{"id":1015,"date":"2011-03-05T15:13:34","date_gmt":"2011-03-05T13:13:34","guid":{"rendered":"http:\/\/neosmart.net\/blog\/?p=1015"},"modified":"2013-08-26T18:19:35","modified_gmt":"2013-08-26T23:19:35","slug":"open-source-100-compatible-ln-for-windows-and-junction-point-library","status":"publish","type":"post","link":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/","title":{"rendered":"Open Source, 100% Compatible ln for Windows (and Junction Point library)"},"content":{"rendered":"<p>We&#8217;ve been huge fans of symlinks for forever, and even posted about Windows Vista&#8217;s <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/cc753194(WS.10).aspx\" rel=\"follow\">new mklink<\/a> commandline utility with <a href=\"https:\/\/neosmart.net\/blog\/symlinks-on-vista\/\" rel=\"follow\">quite the passion<\/a> back in 2006 when the ability to create soft-links from the commandline was first added to Windows.<\/p>\n<p>However, there are a few things that have forever irked us about the ln lookalike called mklink.exe:<\/p>\n<ul>\n<li>It&#8217;s called mklink and not ln. (I mean, you just get can&#8217;t get around that fact)<\/li>\n<li>The arguments are switched around. `mklink something_doesnt_exist actual_file` is just&#8230;&#8230;.. wrong!<\/li>\n<li>By default, mklink will create softlinks and not hardlinks. ln requires the \/h flag to create a hardlink.<\/li>\n<li>mklink isn&#8217;t smart enough to distinguish between files and folders. You need explicitly tell it via the commandline.<\/li>\n<li>Even then, mklink has <em>two <\/em>different switches depending on the type of directory link you want. \/D for softlink&#8217;d directories, and \/J for hardlink&#8217;d directories.<\/li>\n<li>mklink can&#8217;t be used outside of cmd.exe (such as in PowerShell). <small>(Hat tip: <a href=\"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/\" rel=\"follow\">Jason<\/a>)<\/small><\/li>\n<li>And, of course, \u00a0mklink isn&#8217;t open source.<\/li>\n<\/ul>\n<p>So we made our own.<\/p>\n<p><!--more--><\/p>\n<p>ln-win is available in 32-bit and 64-bit, uses the same syntax, names, switches, and argument ordering as ln on *nix. And pursuant to <a href=\"https:\/\/neosmart.net\/blog\/contributing-to-the-open-source-community\/\" rel=\"follow\">our promise<\/a> to contribute more to open source, ln-win and our Junction Point library is 100% open source, freely licensed under the generous terms of the MIT license.<\/p>\n<p>Perhaps more importantly, ln-win contains an open source Junction Point library. While Win32 APIs exist to create symlinks (on Vista and up), there is no API for creating hardlinks of any kind (for files or folders). The NeoSmart JunctionPoint library provides the following APIs:<\/p>\n<pre class=\"code\">\tbool CreateJunctionPoint(LPCTSTR origin, LPCTSTR junction);\r\n\tbool IsDirectoryJunction(LPCTSTR path);\r\n\tbool GetJunctionDestination(LPCTSTR path, OUT LPTSTR destination);\r\n\tbool DeleteJunctionPoint(LPCTSTR path);\r\n<\/pre>\n<p>As you can see, the NeoSmart JunctionPoint library provides all the APIs you need both to create and interact with hardlinks. IsDirectoryJunction can be used for both symlinks and hardlinks, making it a snap to make your code symlink\/hardlink aware, letting you intelligently avoid cyclic paths and data duplication for any filesystem traversal needs.<\/p>\n<p class=\"save\"><a href=\"http:\/\/neosmart.net\/Symlinks\/\" rel=\"follow\">Binaries for Windows x86 and x64<\/a><\/p>\n<p class=\"save\"><a href=\"https:\/\/github.com\/NeoSmart\/ln-win\" rel=\"nofollow\">ln-win Source Code on GitHub<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve been huge fans of symlinks for forever, and even posted about Windows Vista&#8217;s new mklink commandline utility with quite the passion back in 2006 when the ability to create soft-links from the commandline was first added to Windows. However, &hellip; <a href=\"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[367,759,779,777,775,776,727,52,901,778],"class_list":["post-1015","post","type-post","status-publish","format-standard","hentry","category-software","tag-download","tag-github","tag-hardlink","tag-library","tag-ln","tag-ln-win","tag-neosmart","tag-open-source","tag-software","tag-symlink"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"We&#039;ve been huge fans of symlinks for forever, and even posted about Windows Vista&#039;s new mklink commandline utility with quite the passion back in 2006 when the ability to create soft-links from the commandline was first added to Windows. However, there are a few things that have forever irked us about the ln lookalike called\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"NeoSmart Technologies\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#article\",\"name\":\"Open Source, 100% Compatible ln for Windows (and Junction Point library) | The NeoSmart Files\",\"headline\":\"Open Source, 100% Compatible ln for Windows (and Junction Point library)\",\"author\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/neosmart\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#organization\"},\"datePublished\":\"2011-03-05T15:13:34-06:00\",\"dateModified\":\"2013-08-26T18:19:35-05:00\",\"inLanguage\":\"en-US\",\"commentCount\":17,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#webpage\"},\"articleSection\":\"Software, download, github, hardlink, library, ln, ln-win, neosmart, open source, software, symlink\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/#listItem\",\"position\":2,\"name\":\"Software\",\"item\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#listItem\",\"name\":\"Open Source, 100% Compatible ln for Windows (and Junction Point library)\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#listItem\",\"position\":3,\"name\":\"Open Source, 100% Compatible ln for Windows (and Junction Point library)\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/category\\\/software\\\/#listItem\",\"name\":\"Software\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#organization\",\"name\":\"The NeoSmart Files\",\"description\":\"Recovery software and more\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/neosmart\\\/#author\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/neosmart\\\/\",\"name\":\"NeoSmart Technologies\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f542321efe8fccee6fb0b3322c2f647e2ab44a861d6b18ff16a79d032f8574cd?s=96&d=mm&r=pg\",\"width\":96,\"height\":96,\"caption\":\"NeoSmart Technologies\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#webpage\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/\",\"name\":\"Open Source, 100% Compatible ln for Windows (and Junction Point library) | The NeoSmart Files\",\"description\":\"We've been huge fans of symlinks for forever, and even posted about Windows Vista's new mklink commandline utility with quite the passion back in 2006 when the ability to create soft-links from the commandline was first added to Windows. However, there are a few things that have forever irked us about the ln lookalike called\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/open-source-100-compatible-ln-for-windows-and-junction-point-library\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/neosmart\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/author\\\/neosmart\\\/#author\"},\"datePublished\":\"2011-03-05T15:13:34-06:00\",\"dateModified\":\"2013-08-26T18:19:35-05:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/\",\"name\":\"The NeoSmart Files\",\"description\":\"Recovery software and more\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/neosmart.net\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Open Source, 100% Compatible ln for Windows (and Junction Point library) | The NeoSmart Files","description":"We've been huge fans of symlinks for forever, and even posted about Windows Vista's new mklink commandline utility with quite the passion back in 2006 when the ability to create soft-links from the commandline was first added to Windows. However, there are a few things that have forever irked us about the ln lookalike called","canonical_url":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#article","name":"Open Source, 100% Compatible ln for Windows (and Junction Point library) | The NeoSmart Files","headline":"Open Source, 100% Compatible ln for Windows (and Junction Point library)","author":{"@id":"https:\/\/neosmart.net\/blog\/author\/neosmart\/#author"},"publisher":{"@id":"https:\/\/neosmart.net\/blog\/#organization"},"datePublished":"2011-03-05T15:13:34-06:00","dateModified":"2013-08-26T18:19:35-05:00","inLanguage":"en-US","commentCount":17,"mainEntityOfPage":{"@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#webpage"},"isPartOf":{"@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#webpage"},"articleSection":"Software, download, github, hardlink, library, ln, ln-win, neosmart, open source, software, symlink"},{"@type":"BreadcrumbList","@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/neosmart.net\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/category\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/category\/software\/#listItem","position":2,"name":"Software","item":"https:\/\/neosmart.net\/blog\/category\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#listItem","name":"Open Source, 100% Compatible ln for Windows (and Junction Point library)"},"previousItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#listItem","position":3,"name":"Open Source, 100% Compatible ln for Windows (and Junction Point library)","previousItem":{"@type":"ListItem","@id":"https:\/\/neosmart.net\/blog\/category\/software\/#listItem","name":"Software"}}]},{"@type":"Organization","@id":"https:\/\/neosmart.net\/blog\/#organization","name":"The NeoSmart Files","description":"Recovery software and more","url":"https:\/\/neosmart.net\/blog\/"},{"@type":"Person","@id":"https:\/\/neosmart.net\/blog\/author\/neosmart\/#author","url":"https:\/\/neosmart.net\/blog\/author\/neosmart\/","name":"NeoSmart Technologies","image":{"@type":"ImageObject","@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/f542321efe8fccee6fb0b3322c2f647e2ab44a861d6b18ff16a79d032f8574cd?s=96&d=mm&r=pg","width":96,"height":96,"caption":"NeoSmart Technologies"}},{"@type":"WebPage","@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#webpage","url":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/","name":"Open Source, 100% Compatible ln for Windows (and Junction Point library) | The NeoSmart Files","description":"We've been huge fans of symlinks for forever, and even posted about Windows Vista's new mklink commandline utility with quite the passion back in 2006 when the ability to create soft-links from the commandline was first added to Windows. However, there are a few things that have forever irked us about the ln lookalike called","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/neosmart.net\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/#breadcrumblist"},"author":{"@id":"https:\/\/neosmart.net\/blog\/author\/neosmart\/#author"},"creator":{"@id":"https:\/\/neosmart.net\/blog\/author\/neosmart\/#author"},"datePublished":"2011-03-05T15:13:34-06:00","dateModified":"2013-08-26T18:19:35-05:00"},{"@type":"WebSite","@id":"https:\/\/neosmart.net\/blog\/#website","url":"https:\/\/neosmart.net\/blog\/","name":"The NeoSmart Files","description":"Recovery software and more","inLanguage":"en-US","publisher":{"@id":"https:\/\/neosmart.net\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"1015","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-23 20:09:03","updated":"2026-01-10 22:04:51","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/neosmart.net\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/neosmart.net\/blog\/category\/software\/\" title=\"Software\">Software<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tOpen Source, 100% Compatible ln for Windows (and Junction Point library)\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/neosmart.net\/blog\/"},{"label":"Software","link":"https:\/\/neosmart.net\/blog\/category\/software\/"},{"label":"Open Source, 100% Compatible ln for Windows (and Junction Point library)","link":"https:\/\/neosmart.net\/blog\/open-source-100-compatible-ln-for-windows-and-junction-point-library\/"}],"jetpack_shortlink":"https:\/\/wp.me\/p4xDa-gn","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/1015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/comments?post=1015"}],"version-history":[{"count":6,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/1015\/revisions"}],"predecessor-version":[{"id":2659,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/1015\/revisions\/2659"}],"wp:attachment":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/media?parent=1015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/categories?post=1015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/tags?post=1015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}