Jump to content
IGNORED

Sparta DOS X 4.49 I/O redirection: is append possible?


beqelessen

Recommended Posts

Hi -

 

I used MS-DOS way back in the day, and I've been a longtime Linux user, so I'm very comfortable with bash. I'm getting my head around SpartaDOS X and really loving its capabilities. (I just got DOSKEY loaded: yummy command history, aliases and more.)

 

I'm wondering if Sparta DOS X supports append in its I/O redirection implementation.

 

It doesn't seem to, as the traditional 'append' syntax is >>, but that's what's used in SDX to indicate 'write'. ( I guess because > is a valid path separator?) I tried >>>, but that didn't have any effect; as in, starting with a file named FILE.TXT containing "THIS", and running the following command, has no effect:
 

ECHO THAT >>>FILE.TXT
TYPE FILE.TXT
THIS

 

Going the whole hog and trying

 

ECHO THAT >>>>FILE.TXT

 

....gave me

 

165 Bad filename

 

And of course

 

ECHO THAT >FILE.TXT

 

...just returns

 

THAT >FILE.TXT

 

The SpartaDOS X 4.49 User Guide doesn't shed any light though tantalizingly the Glossary gives the definition "Simply to add to. To append one file to another is to add the first onto the end of the second. This is often used when loading device handlers."

  • Like 1
Link to comment
Share on other sites

redirect to which device ? D1: DA: D8: DO: ???

 

>>

 

Not sure where your append is coming in...

 

It's simply redirection of output. Does the file all ready exist and you are trying to append to the existing file?

 

4.1 APPEND - add destinations to system path
Purpose
Append the given drive and/or path at the end of the $PATH variable.
Syntax
APPEND d: | pathname | device
Type
External - on CAR: device.
Availability
As of SDX 4.40.
Remarks
Sometimes it is very handy to have the path variable changed temporarily. Especially
while programming and/or administering your system equipped with mass storage
devices like hard drives, flash cartridges, SIO2XX devices etc. The APPEND command
facilitates the task of temporarily adding a device, drive or directory to the $PATH
without manually rewriting all the paths that $PATH contains.

image.png.53a1ee606899bc0551a12a514d1fcba5.png

Fig. 16: Append A Temporary Path

 

and the appending of files or redirection of output as well

 

TYPE README.DOC >>PRN:

TYPE README.DOC >>D4:README2.DOC


The COPY command may also be engaged to append files by using a '/A' immediately
following (no space) the destination filespec. (SD 3.2 allows a '/A' when SAVEing any file
to force append mode - SDX only supports this feature on the COPY command.)

 

Concatenation (combining of files) can be performed during the copy process with the
APPEND parameter '/A', which has to be placed at the end of the command sequence.

 

COPY somefile.txt imafile.txt/A

or add full paths etc.

 

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

On 11/12/2023 at 3:05 AM, _The Doctor__ said:

redirect to which device ? D1: DA: D8: DO: ???

 

>>

 

Not sure where your append is coming in...

 

It's simply redirection of output. Does the file all ready exist and you are trying to append to the existing file?

 

4.1 APPEND - add destinations to system path
Purpose
Append the given drive and/or path at the end of the $PATH variable.
Syntax
APPEND d: | pathname | device
Type
External - on CAR: device.
Availability
As of SDX 4.40.
Remarks
Sometimes it is very handy to have the path variable changed temporarily. Especially
while programming and/or administering your system equipped with mass storage
devices like hard drives, flash cartridges, SIO2XX devices etc. The APPEND command
facilitates the task of temporarily adding a device, drive or directory to the $PATH
without manually rewriting all the paths that $PATH contains.

image.png.53a1ee606899bc0551a12a514d1fcba5.png

Fig. 16: Append A Temporary Path

 

and the appending of files or redirection of output as well

 

TYPE README.DOC >>PRN:

TYPE README.DOC >>D4:README2.DOC


The COPY command may also be engaged to append files by using a '/A' immediately
following (no space) the destination filespec. (SD 3.2 allows a '/A' when SAVEing any file
to force append mode - SDX only supports this feature on the COPY command.)

 

Concatenation (combining of files) can be performed during the copy process with the
APPEND parameter '/A', which has to be placed at the end of the command sequence.

 

COPY somefile.txt imafile.txt/A

or add full paths etc.

 

Thanks @_The Doctor__!

 

Yep, append is one of those overloaded terms. Thanks for finding all those usages.

 

I do use the APPEND command to add paths to the environment variable $PATH for the duration of my session. What I'm talking about here is the other meaning, similar to the COPY command example you gave, but rather than concatenating two files, the data to be concatenated to an existing file is the output of a command.

 

I'm not sure why you think the target device might matter? Curious to know why you mentioned that!

Link to comment
Share on other sites

On 11/12/2023 at 12:00 AM, beqelessen said:

I tried >>>, but that didn't have any effect;

In afterthought:

 

ECHO THAT >>>FILE.TXT

 

is the same as

 

ECHO THAT >>\FILE.TXT

 

i.e. the write should be done to a file named FILE.TXT and located in the main directory of the current drive. Just tried and this works so here.

 

This leaves >>>> for the append mode, which perhaps will be available in the upcoming release.

 

As about APPEND.COM: the Command Processor has evolved a bit since its appearance, so, if

 

C:\BIN\ 

 

is to be added to PATH, then

 

SET PATH=$PATH$;C:\BIN\

 

should work too.

 

 

  • Like 3
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...