add optional logging, cleanup fixes
This commit is contained in:
15
electron/fileUtil.js
Normal file
15
electron/fileUtil.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const fs = require("fs");
|
||||
|
||||
function isWritable(filePath) {
|
||||
let fileAccess = false;
|
||||
try {
|
||||
fs.closeSync(fs.openSync(filePath, "r+"));
|
||||
fileAccess = true;
|
||||
} catch {
|
||||
}
|
||||
return fileAccess;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isWritable,
|
||||
};
|
Reference in New Issue
Block a user