From 627e708064bb5d4b297cf153a564727fcbe264f0 Mon Sep 17 00:00:00 2001 From: Sam Kelly Date: Sun, 12 Mar 2017 06:46:01 -0400 Subject: [PATCH] update README to match latest example.js (#50) --- README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9e1a726..e0e8d6e 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,9 @@ Try creating an empty folder called `mnt` and run the below example ``` js var fuse = require('fuse-bindings') -fuse.mount('./mnt', { +var mountPath = process.platform !== 'win32' ? './mnt' : 'M:\\' + +fuse.mount(mountPath, { readdir: function (path, cb) { console.log('readdir(%s)', path) if (path === '/') return cb(0, ['test']) @@ -50,8 +52,8 @@ fuse.mount('./mnt', { ctime: new Date(), size: 100, mode: 16877, - uid: process.getuid(), - gid: process.getgid() + uid: process.getuid ? process.getuid() : 0, + gid: process.getgid ? process.getgid() : 0 }) return } @@ -63,8 +65,8 @@ fuse.mount('./mnt', { ctime: new Date(), size: 12, mode: 33188, - uid: process.getuid(), - gid: process.getgid() + uid: process.getuid ? process.getuid() : 0, + gid: process.getgid ? process.getgid() : 0 }) return } @@ -82,13 +84,18 @@ fuse.mount('./mnt', { buf.write(str) return cb(str.length) } +}, function (err) { + if (err) throw err + console.log('filesystem mounted on ' + mountPath) }) process.on('SIGINT', function () { - fuse.unmount('./mnt', function (err) { - if (err) throw err - - process.exit() + fuse.unmount(mountPath, function (err) { + if (err) { + console.log('filesystem at ' + mountPath + ' not unmounted', err) + } else { + console.log('filesystem at ' + mountPath + ' unmounted') + } }) }) ```