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
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
After View
Images
tree
dir
Windows Explorer
Explanation
- Tree Command
- Shows the linked files
- dir Command
- Tags the linked files with the <SYMBLINK> flag
- 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
- Microsoft
- Windows Blogs
- Yosef Durr
- Symlinks in Windows 10
Link
- Symlinks in Windows 10
- Yosef Durr
- Windows Blogs