-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Illustrate symlink behavior on Windows
- Loading branch information
0 parents
commit 8df3052
Showing
7 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
In a non-admin shell: | ||
``` | ||
node test-dir.js | ||
> Error: EPERM: operation not permitted, symlink 'XXX\srcDir' -> 'XXX\destDir' | ||
node test-file.js | ||
> Error: EPERM: operation not permitted, symlink 'XXX\srcFile' -> 'XXX\destFile' | ||
node test-junction.js | ||
> (no error, link created) | ||
``` | ||
|
||
All commands work fine in an admin shell. |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const src = path.resolve(__dirname, "srcDir"); | ||
const dest = path.resolve(__dirname, "destDir"); | ||
|
||
fs.symlinkSync(src, dest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const src = path.resolve(__dirname, "srcFile"); | ||
const dest = path.resolve(__dirname, "destFile"); | ||
|
||
fs.symlinkSync(src, dest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
const src = path.resolve(__dirname, "srcDir"); | ||
const dest = path.resolve(__dirname, "destDir"); | ||
|
||
fs.symlinkSync(src, dest, "junction"); |