• console.editfile gives error if files doesn't exist.

    From Nigel Reed@VERT to GitLab issue in main/sbbs on Tuesday, April 22, 2025 13:59:41
    open https://gitlab.synchro.net/main/sbbs/-/issues/914

    My error log contains:

    term Node 1 <adron> !ERROR 2 (No such file or directory) in writemsg.cpp line 1337 (editfile) creating "/sbbs/data/user/0664.sshkeys" access=-1

    It looks like this is created from the following line:

    console.editfile(userSSHKeyFilename);

    The jsobj documents say that editfile should create the file if it doesn't exist.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, April 22, 2025 14:26:06
    https://gitlab.synchro.net/main/sbbs/-/issues/914#note_7113

    Looks like just some ephemeral error, not a reproducible problem with console.editfile() in particular.
    ```
    ;eval
    Parameter(s): console.editfile("nonexistantfile")
    ```
    after the editor saves the file,
    ```
    Result (boolean): true
    ```
    And the file was in fact created:
    ```
    $ ll /sbbs/ctrl/non*
    -rwxrwxrwx 1 sbbs sbbs 14 Apr 22 14:23 /sbbs/ctrl/nonexistantfile
    ```

    So at the very least, the issue title isn't accurate.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, April 22, 2025 14:31:45
    https://gitlab.synchro.net/main/sbbs/-/issues/914#note_7114

    Looking at the code, it does appear that if console.editfile() creates a 0-length file, you'd likely get this error:
    ```
    int sbbs_t::process_edited_file(const char* src, const char* dest, int mode, unsigned* lines, unsigned maxlines)
    {
    char* buf;
    long len;
    FILE* fp;

    if ((len = (long)flength(src)) < 1)
    return -1;
    ```

    I wonder if that's what happened in this case.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, April 22, 2025 15:05:13
    https://gitlab.synchro.net/main/sbbs/-/issues/914#note_7115

    ah yes, that does appear to be the issue. fseditor.js won't create a 0-length file, but slyedit can/will, so that can trigger that error.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nigel Reed@VERT to GitLab note in main/sbbs on Tuesday, April 22, 2025 15:06:08
    https://gitlab.synchro.net/main/sbbs/-/issues/914#note_7116

    Ah that makes sense. I just tried it with another user and it worked fine so that explains it.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab note in main/sbbs on Tuesday, April 22, 2025 15:09:57
    https://gitlab.synchro.net/main/sbbs/-/issues/914#note_7117

    looks like slyedit won't create 0-length file either, it just creates no file when you provide no content:
    ```
    Empty message not sent.
    ```

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to GitLab issue in main/sbbs on Tuesday, April 22, 2025 15:25:37
    close https://gitlab.synchro.net/main/sbbs/-/issues/914

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net