mirror of
https://github.com/electron/node-gyp.git
synced 2025-09-16 05:53:41 +02:00
Add 'fstream' as a dependency.
This commit is contained in:
parent
301f8b82ec
commit
72fa76e585
88 changed files with 156 additions and 708 deletions
24
node_modules/fstream/examples/symlink-write.js
generated
vendored
Normal file
24
node_modules/fstream/examples/symlink-write.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
var fstream = require("../fstream.js")
|
||||
, closed = false
|
||||
|
||||
fstream
|
||||
.Writer({ path: "path/to/symlink"
|
||||
, linkpath: "./file"
|
||||
, isSymbolicLink: true
|
||||
, mode: "0755" // octal strings supported
|
||||
})
|
||||
.on("close", function () {
|
||||
closed = true
|
||||
var fs = require("fs")
|
||||
var s = fs.lstatSync("path/to/symlink")
|
||||
var isSym = s.isSymbolicLink()
|
||||
console.log((isSym?"":"not ") +"ok 1 should be symlink")
|
||||
var t = fs.readlinkSync("path/to/symlink")
|
||||
var isTarget = t === "./file"
|
||||
console.log((isTarget?"":"not ") +"ok 2 should link to ./file")
|
||||
})
|
||||
.end()
|
||||
|
||||
process.on("exit", function () {
|
||||
console.log((closed?"":"not ")+"ok 3 should be closed")
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue