Skip to content
Snippets Groups Projects
Commit cf53e112 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

add file close callback

parent b271ba45
Branches
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// WebSocket device server // WebSocket device server
// //
// Neil Gershenfeld // Neil Gershenfeld
// (c) Massachusetts Institute of Technology 2017 // (c) Massachusetts Institute of Technology 2019
// //
// This work may be reproduced, modified, distributed, performed, and // This work may be reproduced, modified, distributed, performed, and
// displayed for any purpose, but must acknowledge the mods // displayed for any purpose, but must acknowledge the mods
...@@ -100,7 +100,12 @@ wss.on('connection',function(ws) { ...@@ -100,7 +100,12 @@ wss.on('connection',function(ws) {
else { else {
console.log('done') console.log('done')
ws.send('done') ws.send('done')
fs.close(file) fs.close(file,function(err) {
if (err) {
console.log('error: '+err)
ws.send('error: '+err)
}
})
} }
} }
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment