• Linux addfiles from CD

    From Clogan@VERT to All on Monday, August 19, 2019 06:16:00
    In trying to add a CD to the file libraries on a Linux system I've run into
    the following problem. On the CD, all files.bbs files have filenames in uppercase. But the actual filenames on the CD are lower case. When running addfiles, all files show as "not found". By copying a couple of the CD's directories to the HDD so I can edit/modify them, then either modifying
    the filenames in files.bbs to lowercase, OR renaming all the actual files
    to uppercase, addfiles works perfectly adding all files and descriptions.
    Is there a way for addfiles to ignore the difference in case when doing
    a bulk add using files.bbs?


    --- MultiMail/Linux v0.52
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Mortifis@VERT/ALLEYCAT to Clogan on Monday, August 19, 2019 14:57:19
    @MSGID: <5D5A86A5.6161.sync@vert.synchro.net>
    @TZ: c1e0
    In trying to add a CD to the file libraries on a Linux system I've run into the following problem. On the CD, all files.bbs files have filenames in uppercase. But the actual filenames on the CD are lower case. When running addfiles, all files show as "not found". By copying a couple of the CD's directories to the HDD so I can edit/modify them, then either modifying
    the filenames in files.bbs to lowercase, OR renaming all the actual files
    to uppercase, addfiles works perfectly adding all files and descriptions.
    Is there a way for addfiles to ignore the difference in case when doing
    a bulk add using files.bbs?

    I am sure someone can come up with a better script. Try this with jsexec (save it to a file in /sbbs/exec or whereever

    // usage:
    // to copy ALL files from directory use /sbbs/jsexec copyfiles and when prompted for
    // Path from: end the path with /*
    // ie: /sbbs/mods/*
    //
    // there is no need to add a trailing / at the end of Copy to

    load("sbbsdefs.js");

    var os = system.os_version;
    var myos = os.split(" ");
    print('OS = ' + myos[0] +'\r\n');

    if(myos[0].toLowerCase() == 'windows')
    var bs = '\\';
    else var bs = '/';

    if (argc==0)
    path = prompt("Path from");
    else
    path = argv[0];

    if (path==undefined) exit();

    if (path.indexOf('*')<0 && path.indexOf('?')<0)
    path += "*"; // No pattern specified

    path1 = prompt("Copy to");

    if(path1==undefined) exit();

    var lastChar = path1[path1.length -1];



    dir = directory(path,GLOB_PERIOD);


    for (i in dir) {
    if(this.bbs && bbs.sys_status&SS_ABORT) break;
    var fn = dir[i].split(bs);
    var rn = fn[fn.length-1];
    if(rn != '.' || rn != '..') {
    try {
    print('Renaming '+ dir[i] + ' to ' + path1 + bs + rn.toUpperCase());
    js.global.file_copy(dir[i], path1 + bs + rn.toLowerCase());
    }
    catch(err) {
    print("Fuck! " + err);
    }
    }
    }


    then you can use addfiles as per usual (I tested this on windows but it should work on linux



    My doctor said I have the body of a 25 year old ... and the mind of a 10 :-/

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
  • From Gamgee@VERT/PALANT to Clogan on Monday, August 19, 2019 11:52:00
    Clogan wrote to All <=-

    In trying to add a CD to the file libraries on a Linux system
    I've run into the following problem. On the CD, all files.bbs
    files have filenames in uppercase. But the actual filenames on
    the CD are lower case. When running addfiles, all files show as
    "not found". By copying a couple of the CD's directories to the
    HDD so I can edit/modify them, then either modifying the
    filenames in files.bbs to lowercase, OR renaming all the actual
    files to uppercase, addfiles works perfectly adding all files and descriptions. Is there a way for addfiles to ignore the
    difference in case when doing a bulk add using files.bbs?

    Probably easiest to just convert the files.bbs to lowercase...

    This command in linux will do that:

    cat files.bbs | tr '[A-Z]' '[a-z]' > newlist.bbs

    (and then move/rename the list files before importing).



    ... A day without sunshine is like night.
    --- MultiMail/Linux v0.52
    þ Synchronet þ Palantir BBS * palantirbbs.ddns.net * Pensacola, FL
  • From Digital Man@VERT to Clogan on Monday, August 19, 2019 13:22:21
    Re: Linux addfiles from CD
    By: Clogan to All on Mon Aug 19 2019 06:16 am

    In trying to add a CD to the file libraries on a Linux system I've run into the following problem. On the CD, all files.bbs files have filenames in uppercase. But the actual filenames on the CD are lower case. When running addfiles, all files show as "not found". By copying a couple of the CD's directories to the HDD so I can edit/modify them, then either modifying
    the filenames in files.bbs to lowercase, OR renaming all the actual files
    to uppercase, addfiles works perfectly adding all files and descriptions.
    Is there a way for addfiles to ignore the difference in case when doing
    a bulk add using files.bbs?

    I just committed an update to addfiles.c that should address this. Thanks for the detailed problem report.

    digital man

    Synchronet/BBS Terminology Definition #17:
    DCE = Data Communications Equipment (or Deuce, Stephen Hurd)
    Norco, CA WX: 84.0øF, 51.0% humidity, 5 mph E wind, 0.00 inches rain/24hrs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Mortifis@VERT/ALLEYCAT to Digital Man on Monday, August 19, 2019 19:20:18
    @MSGID: <5D5B04FD.6189.sync@vert.synchro.net>
    @REPLY: <5D5A86A5.6161.sync@vert.synchro.net>
    @TZ: c1e0
    Re: Linux addfiles from CD
    By: Clogan to All on Mon Aug 19 2019 06:16 am

    In trying to add a CD to the file libraries on a Linux system I've run into the following problem. On the CD, all files.bbs files have filenames in uppercase. But the actual filenames on the CD are lower case. When running addfiles, all files show as "not found". By copying a couple of the CD's directories to the HDD so I can edit/modify them, then either modifying
    the filenames in files.bbs to lowercase, OR renaming all the actual files to uppercase, addfiles works perfectly adding all files and descriptions. Is there a way for addfiles to ignore the difference in case when doing
    a bulk add using files.bbs?

    I just committed an update to addfiles.c that should address this. Thanks for the detailed problem report.

    LOL, like I said in my reply, "I am sure someone(DM :) has a better solution" than the script I posted :-P


    My doctor said I have the body of a 25 year old ... and the mind of a 10 :-/

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
  • From Clogan@VERT to Digital Man on Monday, August 19, 2019 16:10:13
    Re: Linux addfiles from CD
    By: Digital Man to Clogan

    I just committed an update to addfiles.c that should address this. Thanks for the detailed problem report.

    Thanks for the quick response! I'll check out the new commit.

    And thanks to all that responded with ideas and suggestions!

    Chuck

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From mark lewis@VERT to Gamgee on Tuesday, August 20, 2019 09:15:14
    On 2019 Aug 19 11:52:00, you wrote to Clogan:

    Probably easiest to just convert the files.bbs to lowercase...

    This command in linux will do that:

    cat files.bbs | tr '[A-Z]' '[a-z]' > newlist.bbs

    that'll convert the descriptions, too... then we lose all that BeauTiFuL CaMeL/LeeT CaSe text :P

    )\/(ark

    Once men turned their thinking over to machines in the hope that this would set
    them free. But that only permitted other men with machines to enslave them.
    ... We can't have a crisis today, my schedule is already full.
    ---
    * Origin: (1:3634/12.73)
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Dan Clough@VERT to mark lewis on Tuesday, August 20, 2019 15:11:00
    mark lewis wrote to Gamgee <=-

    Probably easiest to just convert the files.bbs to lowercase...
    This command in linux will do that:
    cat files.bbs | tr '[A-Z]' '[a-z]' > newlist.bbs

    that'll convert the descriptions, too... then we lose all that
    BeauTiFuL CaMeL/LeeT CaSe text :P

    Ooooh... good catch.

    Hmmmm, better to change the case of the filenames on disk then, I
    guess.

    But probably neither is needed now, saw that DM has made a fix
    for this in the Addfiles code.



    ... Gone crazy, be back later, please leave message.
    === MultiMail/Linux v0.52
    --- SBBSecho 3.08-Linux
    * Origin: Palantir * palantirbbs.ddns.net * Pensacola, FL * (1:123/115)
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net