Jump to content
IGNORED

SpartaDOS X 4.48


drac030

Recommended Posts

At least it exactly behaves as described in the manual:

The root in that example from Level42 is considered to be the specified directory from which the COM files, if any, will be copied. So it works. Please look up the examples in the manual on page 51.

 

Nevertheless it would be nice to have such a tool at hand to fetch the desired file types from the structure of a drive.

 

But I guess it will get difficult depending on the size of the drive, the directory tree (as the path is limited to 63 chars) and, last but not least, the number of files.

 

For example see the capacities of the MENU command to understand.

 

I did read the man page, and now the manual (which has the same wording) but did not interpret it to mean that usage was limited to the specific example given. The documentation prior to that states that a filespec of *.* is assumed unless unless one is provided. Nowhere does it say that use of the /R switch disallows a filespec other than *.* from being used. And as FJC pointed out, if a filespec is meant to be ignored when the /R is present, then you would expect it to act the same as not providing one and copy everything. But anyway, I thought I would bring it forth as Konrad had been asking for feedback. I would guess it's probably something he might want to address, but if not it might be helpful for the dox to clarify that /R is meant to be used on all files and directories and a user supplied one is excluded in that use case.

Link to comment
Share on other sites

And as FJC pointed out, if a filespec is meant to be ignored when the /R is present, then you would expect it to act the same as not providing one and copy everything.

On reflection, it appears to be the other way round: the presence of a file mask causes the /R switch to be completely ignored.

  • Like 2
Link to comment
Share on other sites

On reflection, it appears to be the other way round: the presence of a file mask causes the /R switch to be completely ignored.

 

Astute observation. I just ran into something else now. I can't load FDISK. I get an error loading FDISK0.OVL. Using the FDISK from the CAR: in the SDX 4.49C rev. Also, using Altirra 3.00 and doing so under WINE. Have CPU type set to 65C816 21MHz, but I tested with 6502/6502C 1.79MHz as well with same result.

Link to comment
Share on other sites

 

Astute observation. I just ran into something else now. I can't load FDISK. I get an error loading FDISK0.OVL. Using the FDISK from the CAR: in the SDX 4.49C rev. Also, using Altirra 3.00 and doing so under WINE. Have CPU type set to 65C816 21MHz, but I tested with 6502/6502C 1.79MHz as well with same result.

Yes, I discovered this awhile back in another thread. The Hidden attribute has to be set for those .OVL files using the SDX Imager tool and then the rom reflashed to whatever you’re using (cart, U1MB, etc).

 

Apparently this will be fixed going forward.

  • Like 3
Link to comment
Share on other sites

Yes, I discovered this awhile back in another thread. The Hidden attribute has to be set for those .OVL files using the SDX Imager tool and then the rom reflashed to whatever you’re using (cart, U1MB, etc).

 

Apparently this will be fixed going forward.

 

Thanks for the info. I'll give it a try. Is there a SDX beta thread that I haven't found or something?

Link to comment
Share on other sites

I'm not aware of any method for detecting installed drivers, but you could define a couple of large environment variables which would exhaust the environment space if ENV.SYS is not present and use the "IF ERROR" conditional to check for an "Environment full" condition (which would denote that ENV.SYS was not loaded).

  • Like 1
Link to comment
Share on other sites

I know in real dos SJC made a detection phase that listed out the system and could be used to make a config. I kind of like the this is what you have what to you want approach, but I would prefer it as a stand alone configurator.... turn on what you want, run it and make your choices save the config... then use it with a boot selector menu...

turn on the Atari select a config, the batch run and swaps you partitions drives, drivers, etc etc etc...

Link to comment
Share on other sites

I'm making a new batch file for use with 4.49C (listing follows), but as I go to test it I get an error 137 truncated record. The manual says this is basically a buffer overrun on CIO input, but that SDX does it differently. I can't figure out what could be wrong.

echo on
; TKUPDATE.BAT
; Toolkit Update by FujiDude 2018-02-19
; This script requires the use of ENV.SYS and the PHD.COM
; & PLD utilities to be in the syetm path.


PROC info
    echo .This updater recursively goes through the source and
    echo .copies all .MAN .TXT .DOC files it finds to the MAN
    echo .directory of the target path.  Likewise it does the
    echo .same for .SYS files but to the DRIVERS directory, and
    echo .finally .COM .EXE .XEX .BAT .OVL to the BIN directory.
    echo .
    echo .     USAGE: -$_11$ TOOLKIT-SOURCE-PATH [TARGET PATH]
    echo .     Source path is required, target path is optional
    echo .     and will be current directory unless provided.
    echo .
RETURN


proc task
    copy *.sys $dp$>drivers
    copy *.com $dp$>bin
    copy *.exe $dp$>bin
    copy *.ovl $dp$>bin
    copy *.ini $dp$>bin
    copy *.bat $dp$>bat
    copy *.man $dp$>man
    copy *.txt $dp$>man
    copy *.doc $dp$>man
    for %a in -s *.arc /n
        ;ARC lets you combine these but the CL would be too long probably.
        arc x %a $dp$>drivers>*.sys
        arc x %a $dp$>bin>*.com
        arc x %a $dp$>bin>*.exe
        arc x %a $dp$>bin>*.xex
        arc x %a $dp$>bin>*.ovl
        arc x %a $dp$>bin>*.bat
        arc x %a $dp$>man>*.man
        arc x %a $dp$>man>*.txt
        arc x %a $dp$>man>*.doc
    next %a
return


proc walkdir
    gosub task
    if exists +s *.*
        for %d in +s *.*
            cd $%d
            gosub walkdir
            cd <
        next %d
    fi
return


;Main program
load command.com
seterrno 0
echo .
echo .SDX Toolkit Updater by FujiDude ver. 2018-02-19.
echo .Requires the use of ENV.SYS and the PHD & PLD
echo .utilities to be in the system path.
echo .

; Is a source specified?
if _11
    if _11=="/H" OR _11=="-H"
        gosub info
        exit
    fi
else
    gosub info
    exit 156
fi

;Does specified source exist?
if exists +s $_11$
    set sp=$_11$
else
    exit 150
fi

;Was a target specified?
if _21
    ;Does specified target exist?
    if exists $_21$
        set dp=$_21$
    else
        exit 150
    fi
else
    set dp=.
fi

phd
chdir $sp$
echo .Processing...
gosub walkdir
echo .
echo .Updated.
echo .
pld
set sp
set dp
load

Link to comment
Share on other sites

The maximum capacity of SDX command line buffer is 64 characters. It seems that you have exceeded this limit (especially shortening the comments may help).

 

Thanks I'll take a look, but I didn't think comments were subject to the command line limit given that they are ignored.

Link to comment
Share on other sites

They are in the count, they are skipped during process but not excluded from the buffer

 

Actually... here's what I verified through research & testing:

  1. A command line is limited to 64 characters (which I should have already known before I started).
  2. Comment lines in batch files are not limited to 64 characters.
  3. The issue I posted about was indeed a CL input of greater than 64 characters, but it was an actual operable command sequence which exceeded the limit; not a comment line.
  4. I somehow was under the fog that what I had written was within the acceptable limits even though there was at least one (non comment) CL which had exceeded it.

Thank you guys for your feedback so far. It's always appreciated! :)

  • Like 4
Link to comment
Share on other sites

Okay. So I put together a couple of scripts (.BAT files) that I wanted for my own use but which others might find useful too. The 1st one lets you specify a path where a tree of various files are and then copy them to a few key folders that would/should be put in your system path. See the table in the actual code for an example.

echo off
; TKUPDATE.BAT
; Toolkit Update by FujiDude 2018-02-19
; This script requires the use of ENV.SYS driver and the
; PHD & PLD utilities.  PHD and PLD must be in the syetm path.


proc info
  echo .This updater recursively goes through the source and
  echo .copies all files of certain types to the target path
  echo .as indicated in the following table:
  echo .
  echo .  FOLDER  : EXTENSIONS
  echo .  --------:-------------------------
  echo .  BIN     : .COM .EXE .XEX .OVL .INI
  echo .  SCRIPTS : .BAT
  echo .  DRIVERS : .SYS
  echo .  MAN     : .MAN .TXT .DOC
  echo .
  echo .Also, ENV.SYS must be loaded and the toolkit PHD, PLD,
  echo .and CDD utilities need to be in the system path.
  echo .
  echo .  USAGE: -%0 SOURCE_PATH TARGET_PATH
  echo .  Both source & target path are required.
  echo .  EXAMPLE .SYS files will go in TARGET_PATH>DRIVERS
  echo .
return


proc task
  echo .
  echo .Processing directory $%d$ ...
  if exists -s *.
    copy *.com %2>bin>
  fi
  if exists -s *.exe
    copy *.exe %2>bin>
  fi
  if exists -s *.xex
    copy *.xex %2>bin>
  fi
  if exists -s *.ovl
    copy *.ovl %2>bin>
  fi
  if exists -s *.ini
    copy *.ini %2>bin>
  fi
  if exists -s *.bat
    copy *.bat %2>scripts>
  fi
  if exists -s *.sys
    copy *.sys %2>drivers>
  fi
  if exists -s *.man
    copy *.man %2>man>
  fi
  if exists -s *.txt
    copy *.txt %2>man>
  fi
  if exists -s *.doc
    copy *.doc %2>man>
  fi

  for %f in -s *.arc /N
    ; ARC allowes combining these but CL might get too long?
    ; Expermient later to combine more to improve performance.
    arc e $%f$ %2>bin>*.com
    arc e $%f$ %2>bin>*.exe
    arc e $%f$ %2>bin>*.xex
    arc e $%f$ %2>bin>*.ovl
    arc e $%f$ %2>bin>*.ini
    arc e $%f$ %2>scripts>*.bat
    arc e $%f$ %2>drivers>*.sys
    arc e $%f$ %2>man>*.man
    arc e $%f$ %2>man>*.txt
    arc e $%f$ %2>man>*.doc
  next %f
return


proc walkdir
  gosub task
  for %d in +s *.*
    cd $%d$
    gosub walkdir
    cd <
  next %d
return


; Main program
load command.com
seterrno 0
set %d=%1
echo .SDX Toolkit Updater by FujiDude ver. 2018-02-25.
echo .

; Is a source specified?
if not _11
  gosub info
  echo *** ERROR: missing source path
  exit
fi

; Is a target specified?
if not _21
  gosub info
  echo *** ERROR: missing target path
  exit
fi

if not exists +s %2>bin
  mkdir %2>bin
fi

if not exists +s %2>scripts
  mkdir %2>scripts
fi

if not exists +s %2>drivers
  mkdir %2>drivers
fi

if not exists +s %2>man
  mkdir %2>man
fi

phd
cdd %1
echo .Updating %2 from %1 ...
gosub walkdir
echo .
echo .Updating complete.  Don't forget to ensure the following
echo .are in your PATH if they aren't already:
echo .   %2>bin
echo .   %2>scripts
echo .   %2>drivers
echo .
echo .and likewise for MANPATH:
echo .   %2>man
echo .
pld
load


And the 2nd one just does a recursive directory sort:

echo off

proc task
  echo .
  echo .Processing directory $%d$ ...
  sortdir .
return


proc walkdir
  gosub task
  for %d in +s *.*
    cd $%d$
    gosub walkdir
    cd <
  next %d
return


; Main program
load command.com
seterrno 0
echo .SDX Recursive SORTDIR by FujiDude ver. 2018-02-25.
echo .
set %d=%1
phd
cdd %1
gosub walkdir
pld
load

Edited by fujidude
  • Like 1
Link to comment
Share on other sites

 

And the 2nd one just does a recursive directory sort:

echo off

proc task
  echo .
  echo .Processing directory $%d$ ...
  sortdir .
return


proc walkdir
  gosub task
  for %d in +s *.*
    cd $%d$
    gosub walkdir
    cd <
  next %d
return


; Main program
load command.com
seterrno 0
echo .SDX Recursive SORTDIR by FujiDude ver. 2018-02-25.
echo .
set %d=%1
phd
cdd %1
gosub walkdir
pld
load

I like the second one because I do a lot of directory sorts. But I modified this one to sort by switch /t so my Graphics and media files stay in my sort order..

And also the second on can be modified to do a recursive CHTD *.* of all folder in the partition..

  • Like 1
Link to comment
Share on other sites

I like the second one because I do a lot of directory sorts. But I modified this one to sort by switch /t so my Graphics and media files stay in my sort order..

And also the second on can be modified to do a recursive CHTD *.* of all folder in the partition..

 

Of course they can be modified and I'm happy to hear that they are. I encourage it. That's what I had in mind back when I posted the RUNPACK.BAT and mentioned the "walkdir" (along with a task of course) procedure could be adapted to do any number of useful things. Long live SpartaDOS!

Link to comment
Share on other sites

Huston, I think we may have a bug. See the example code below.

echo off
; Bug test of SDX 4.49c
; File for loop fails to ignore comment
; lines and attempts to execute them.

for %f in -s *.*
  ; comment 1
  ; comment 2
  echo $%f$
next %f


; Now without comments

for %f in -s *.*
  echo $%f$
next %f
Link to comment
Share on other sites

The following batch file generates a "File not found" error, so I think we may conclude that white space ahead of the semicolon is disallowed:

 

; comment
      ; comment
Page 115 of the manual says:

 

A text line starting with a semicolon is understood as a comment and skipped without parsing

Seems to work as per the description, although one could argue that the "skipped line" behaviour is inconsistent with the fact that comments may have leading space if placed after parsed commands.

Edited by flashjazzcat
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...