Skip to content

Commit

Permalink
[doc] Added example for chroot
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Feb 16, 2011
1 parent 9d2eefa commit 4b25241
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/chroot.js
@@ -0,0 +1,14 @@
var sys = require('sys'),
daemon = require('daemon'),
fs = require('fs');

daemon.chroot('/tmp/chroot');
sys.puts('Working in chroot');

setInterval(function () {
fs.readdir("./", function (err, files) {
sys.puts('Current directory: ' + process.cwd());
sys.puts('err: ' + sys.inspect(err));
sys.puts('files: ' + sys.inspect(files));
});
}, 10000 );

0 comments on commit 4b25241

Please sign in to comment.