• huh? maybe I"m dense, but ...

    From Richard Webb@1:116/901 to all on Sun Apr 3 19:26:06 2011
    HI folks,


    Maybe I'm a bit slow on the uptake but this imho should
    work.

    USing Timo from FInland's little tool basexten.exe to
    capture the extension of a file to an environ var.
    Say in this case, the current nodelist, so we capture it as
    an environ var of 091 as %BASEXTEN% when called for.

    So then we try to look for
    if exist NODELIST.%BASEXTEN% goto yes
    goto nope

    OF course "yes and "nope" indicate to us which we got.

    I've found this before iirc when trying to look for a file
    with an extension indicated by an environment variable. OF
    course this is dos 6.22.
    THoughts anyone?


    Regards,
    Richard
    --- timEd 1.10.y2k+
    * Origin: (1:116/901)
  • From BEN RITCHEY@1:393/68 to RICHARD WEBB on Mon Apr 4 02:49:26 2011
    * An ongoing debate between Richard Webb and All rages on ...

    | RW> if exist NODELIST.%BASEXTEN% goto yes

    Maybe the leading zero is being truncated? or the BASEXTEN variable already has a leading dot? Looks fine otherwise {shrug}

    --
    Be well :^)

    : Ben aka cMech http://bellsouthpwp.net/c/m/cmech617/
    :
    + WildCat! Board 24/7 +1-337-984-4794 any BAUD 8,N,1
    --- GoldEd+/DOS v1.1.5cM
    * Origin: FIDONet - The Positronium Repository (1:393/68)
  • From Richard Webb@1:116/901 to BEN RITCHEY on Mon Apr 4 13:16:00 2011
    HI Ben,

    On Mon 2039-Apr-04 02:49, BEN RITCHEY (1:393/68) wrote to RICHARD WEBB:

    | RW> if exist NODELIST.%BASEXTEN% goto yes

    Maybe the leading zero is being truncated? or the BASEXTEN variable
    already has a leading dot? Looks fine otherwise {shrug}

    NOpe, just won't let you look at file.ext and look at .ext
    when indicated by an env var. Noticed this a couple times
    over the years and found some sorta kludgy workarounds to
    it, but thought I might be missing something.

    Another place I was trying to do that one ...

    My system stores the julian day number anyway. ONly thing
    is, nodelist updates happen next day utc here. That's when
    they arrive.
    But, for other purposes, I store Julian day as environment
    variable daynum.

    SO trying to find out

    if exist log.%DAYNUM% goto gotit
    goto no
    would send me branching to no as well.
    Been there done that one <grin>.

    Regards,
    Richard
    --- timEd 1.10.y2k+
    * Origin: (1:116/901)
  • From Paul Quinn@3:640/384 to Richard Webb on Tue Apr 5 10:01:00 2011
    Hi! Richard,

    In a message to Ben Ritchey you wrote:

    On Mon 2039-Apr-04 02:49, BEN RITCHEY (1:393/68) wrote to RICHARD
    WEBB:

    | RW>> if exist NODELIST.%BASEXTEN% goto yes

    Maybe the leading zero is being truncated? or the BASEXTEN
    variable already has a leading dot? Looks fine otherwise
    {shrug}

    NOpe, just won't let you look at file.ext and look at .ext
    when indicated by an env var. Noticed this a couple times
    over the years and found some sorta kludgy workarounds to
    it, but thought I might be missing something.

    About the only thing you're missing is _not_ running MS-DOS 7.x-something. :)
    You really need to pick up an old copy of Win95 or Win98; I'm sure if you then just delete or rename Win.Com then the GUI just cannot start. You'd probably get the side-benefit of having a NetBIOS client with access to a network (I used to do similar but using a different method, years ago). In any case, DOS 7.xx even allows for line-by-line evaluation of batch statements including percent variables at a command-line; you'd be limited somewhat by not having the GUI to cut & paste from however.

    In separating the elements of a filename I use Horst's NSET, like this...

    -----8<-----C-U-T--H-E-R-E----->8-----
    :: What's the name of the newest net segment file, then?
    DIR /O-D/B/S %DOWNLOAD%\%SEG_BASE%.*|NSET /L1 SEGMFILE=$0
    :: What's the net segment's filename extension?
    DIR %SEGMFILE% /B|NSET /S. SEGM_NUM=$2

    :: Now stick it where MakeNL can pick it up from...
    LOGECHO + $D-$N-$C$Y $h:$m:$s Moving %SEG_BASE%.%SEGM_NUM% to the updates dir! >>%UTILSLOG%
    MOVE /Y %DOWNLOAD%\%SEG_BASE%.%SEGM_NUM% %WORK_DIR%\updates -----8<-----C-U-T--H-E-R-E----->8-----

    Although it's called every day that one exectutes a minimum of once a week. It
    looks for net segment submissions from NCs within my region (#54).

    Yesterday I ran a test with my alias file (FREQ list) generator batch in a MS-DOS 6.22 VirtualBox using a virtual 16meg HDD for data, which uses NSET and a similar technique for splitting-out the bits of filenames, and it ran though the lot in near record time: 40 seconds. It surprised the pants off me. ;-)

    Maybe if you do an ECHO or three instead of the GOTOs you might actually see what's going on? Also, perhaps try using NSET instead of that other util.[shrug]

    Cheers,
    Paul.

    ---
    * Origin: Soylent green is people. (3:640/384)
  • From Richard Webb@1:116/901 to BEN RITCHEY on Tue Apr 5 03:37:20 2011
    HI Ben,

    On Mon 2039-Apr-04 02:49, BEN RITCHEY (1:393/68) wrote to RICHARD WEBB:

    Maybe the leading zero is being truncated? or the BASEXTEN variable
    already has a leading dot? Looks fine otherwise {shrug}

    YEp, TImo's basexten gives you the leading dot, and still
    doesn't play right for if exist when the filename or
    extension includes an environment variable.

    But, there's a workaround.

    IN this case, grab the file name via other means, separate
    the extension off by itself, capture it with one of HOrst's
    many fine little goodies and it's rock 'n roll time.

    sO, TImo's basexten is essentially useless to me, but i sure use basename.exe from his same package.

    Regards,
    Richard
    --- timEd 1.10.y2k+
    * Origin: (1:116/901)
  • From Richard Webb@1:116/901 to Paul Quinn on Tue Apr 5 03:52:46 2011
    Hi Paul,

    On Tue 2039-Apr-05 10:01, Paul Quinn (3:640/384) wrote to Richard Webb:

    About the only thing you're missing is _not_ running MS-DOS
    7.x-something. :) You really need to pick up an old copy of Win95
    or Win98; I'm sure if you then just delete or rename Win.Com then
    the GUI just cannot start. You'd probably get the side-benefit of
    having a NetBIOS client with access to a network (I used to do
    similar but using a different method, years ago). In any case, DOS
    7.xx even allows for line-by-line evaluation of batch statements
    including percent variables at a command-line; you'd be limited
    somewhat by not having the GUI to cut & paste from however.

    Have heard of that, and iirc seen it with 98. Iirc in
    io.sys doing a bootgui=0 will give one much the same.

    I went with a horst deal too, eventually uses nset, but we
    wanted to make sure that .tic processor did its sends first, then our big batch
    from hades that looks at all semaphores
    sees a semaphore indicating that it should merge the
    nodediff, process it.

    I used your method iirc for deleting the oldest of a group
    of .txt files in a directory osme time back iirc. That
    works rather nice too.

    SO even before we get there, we dearchive nodediff arc file
    and capture raw file name of its contents, use horst's
    listmod to separate the actual extension, stow that within
    the semaphore file that is going to be used to trigger
    nodediff processing.

    Now we've got just what we need, stowed as an environment
    variable and available, and usable to create temporary
    batches on the fly.

    See my msg to Ben written right before I received this one.
    "IF you can't go through, go around."

    AS I noted to Ben, I sure use Timo Salmi's basename.exe
    though. THat's the little gem that helps me capture subject lines for arrl bulletins I post in another echo <grin>.

    IF HOrst charged money for this stuff I'd sure have to pay
    up, cause I find myself using his stuff for so many jobs!
    Especially listmod and nset.

    Regards,
    Richard
    --- timEd 1.10.y2k+
    * Origin: (1:116/901)