From 21d0ad9e59a18eda466567beaff76d9ffbae0e69 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 13 Aug 2022 10:49:44 -0600 Subject: [PATCH] Change scann/toss watch msg again, use access() over exists() --- core/scanner_tossers/ftn_bso.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index 97bd9304..e4c2254f 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -2778,16 +2778,9 @@ FTNMessageScanTossModule.prototype.startup = function (cb) { }); const makeImportMsg = (e, path) => { - const indicator = - { - change: '~', - add: '+', - delete: '-', - exists: '=', - }[e] || ''; - return `Import/toss due to @watch [${indicator}]: ${paths.basename( + return `Import/toss due to @watch[${e}] "${paths.basename( path - )}`; + )}"`; }; ['change', 'add', 'delete'].forEach(event => { @@ -2806,8 +2799,9 @@ FTNMessageScanTossModule.prototype.startup = function (cb) { // If the watch file already exists, kick off now // https://github.com/NuSkooler/enigma-bbs/issues/122 // - fse.exists(importSchedule.watchFile, exists => { - if (exists) { + fse.access(importSchedule.watchFile, fse.constants.R_OK, err => { + if (!err) { + // exists and we can read tryImportNow( makeImportMsg('exists', importSchedule.watchFile), {