• Using ddfilelister.js as loadable module with default.js command shell

    From Eric Oulashin@1:103/705 to GitLab issue in main/sbbs on Sat Sep 16 16:17:33 2023
    open https://gitlab.synchro.net/main/sbbs/-/issues/635

    If ddfilelister.js is set up as a loadable module, then when doing a file list, when the user presses Q to quit out of ddfilelister, the message "Empty directory." is displayed. That appears to be one of the strings in text.dat, and ddfilelister does not contain that string, nor does ddfilelister reference that string from text.dat.This does not happen when using my own custom JS command shell.Output when quitting ddfilelister in this case (pressing Q to quit, or arrowing over to the Quit option and pressing enter):░▒▓███████████████▌Info▐▌View▐▌Batch▐▌DL▐▌Move▐▌DEL▐▌?▐▌Quit▐██████████████▓▒░Empty directory.[Hit a key]ddfilelister can be set up as a loadable module in SCFG:Scan Dirs ../xtrn/ddfilelister/ddfilelister.jsList Files ../xtrn/ddfilelister/ddfilelister.jsI'm not sure I have enough information to know why this is happening. In default.js, line 247 seems to be what evaluates the JS (which in this case initiates the file list), and the "Empty directory" message appears after the command is evaluated:~~~if(menu_cmd.eval) eval(menu_cmd.eval);~~~- "Empty Directory." message appears here, after ddfilelister runs and the user quits out of itThe JS comes from the file_menu object, and on line 124, it defines this for L:~~~'L': { eval: 'shell.list_files()' },~~~
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Sep 16 16:34:49 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/635#note_4098

    I suspect the message is coming from list_files() in load/shell_lib.jsIf your list files module returns 0, that indicates to the caller that 0 files were listed (the directory is empty).Is the return value of your file list module the number of listed files?The Baja FILE_LIST function *first* checks to see if the directory is empty before calling the sbbs_t::listfiles() function (which will execute the file list module if there is one configured), so this is a bit different from how we do this from JS shells.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab note in main/sbbs on Sat Sep 16 17:02:52 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/635#note_4099

    Ah, I didn't realize it had to return the number of files listed. I updated it to do so, and that helped. I see Synchronet outputs the number of files listed. Is that also the case when searching for text in file description or when searching by filename? When searching the descriptions, Synchronet doesn't output the number of files listed/found.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Sat Sep 16 17:40:05 2023
    https://gitlab.synchro.net/main/sbbs/-/issues/635#note_4101

    The file list module is expected to return the number of listed files in all modes.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Eric Oulashin@1:103/705 to GitLab issue in main/sbbs on Sat Sep 16 18:39:33 2023
    close https://gitlab.synchro.net/main/sbbs/-/issues/635
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)