jrudess / streamdvr

DVR for streaming entertainment
GNU General Public License v3.0
67 stars 16 forks source link

streamdvr quits when "captured" directory exists #113

Closed lukiluki123 closed 5 years ago

lukiluki123 commented 5 years ago

When "capturing" or "captured" directory exists I get the following error:

fs.js:909 return binding.mkdir(pathModule.toNamespacedPath(path),

The solution is very easy, replace mkdir function in dvr.js with this:

mkdir(dir) { const fulldir = path.resolve(dir); if (!fs.existsSync(fulldir)) { fs.mkdirSync(fulldir, {recursive: true}, (err) => { if (err) { this.log(err.toString()); process.exit(1); }; }); }; return fulldir; }

jrudess commented 5 years ago

I suspect your version of node is too old. The {recursive: true} option is what allows it to not fail when the directory exists.