WinOS – File System – Symbolic Links

Background

When blogging one tries out various scenarios across different platforms.

File System

Symbolic Links

Need

As I was working on compiling time-windows I wanted to have a couple of branches.

One for compilation with Microsoft Visual Studio and another branch for compiling with MinGW ( Minimalist GNU for Windows).

Premise

The code is C and it should be portable.

Having said that, the compiler binary and corresponding options will be slightly different.

Before View

Images

tree

tree.01.20200522.0930AM

explanation

There are two files, Timemem.c and TimeMem.ico that are currently in our root folder.

We will link to them from our build folder as we try out each new compiler/

Create Link

Script


if not exist TimeMem.c   mklink TimeMem.c ..\..\TimeMem.c

if not exist TimeMem.ico mklink TimeMem.ico ..\..\TimeMem.ico 

Output

Output – Image

mkLink.01.20200522.1049AM

After View

Images

tree
tree.02.20200522.1054AM
dir

dir.02.20200522.1055AM

Windows Explorer

explorer.02.20200522.1059AM

 

Explanation

  1. Tree Command
    • Shows the linked files
  2. dir Command
    • Tags the linked files with the <SYMBLINK> flag
  3. Windows Explorer
    • Symbolically linked files tagged with .symlink

Summary

Using symbolically linked files via the mklink command one can hopefully keep a single file via, yet expose it using an abstract name.

 

References

  1. Microsoft
    • Windows Blogs
      • Yosef Durr
        • Symlinks in Windows 10
          Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s