Suntan Special version 0.69

Suntan Special Web edition

EditFile

Suntan Special Function: EditFile

EditFile is used to make changes to a text file. EditFile takes commands from a queue or from standard input, and executes them on the text file.

The commands placed on the queue are case sensitive.

Syntax:

queueName = 'nul'
queue 'ReadConfigFile'
(queue other commands)
queue 'WriteConfigFile'
queue 'exit'
call EditFile queueName, textFilename

Program Arguments

  1. queueName - queue to read for instructions; use 'nul' to indicate standard input
  2. textFilename - name of the text file to edit

Returns:

(nothing)

Commands

Command name Description
ReadConfigFile Must be the first command; reads the file into memory
AppendToPath <directory> Adds <directory> to the end of the PATH statement. If <directory> is already in path, no action is taken.
PrependToPath <directory> Adds <directory> to the beginning of the PATH statement. If <directory> is already in path, no action is taken.
AppendToLibPath <directory> Adds <directory> to the end of the LIBPATH statement. If <directory> is already in path, no action is taken.
PrependToLibPath <directory> Adds <directory> to the beginning of the LIBPATH statement. If <directory> is already in path, no action is taken.
AppendToDPath <directory> Adds <directory> to the end of the SET DPATH statement
AppendToBookshelf <directory> Adds <directory> to the end of the SET BOOKSHELF statement
AppendToClasspath <directory> Adds <directory> to the end of the SET CLASSPATH statement
AppendToHelp <directory> Adds <directory> to the end of the SET HELP statement
AppendToSomir <som file> Adds <som file> to the end of the SET SOMIR statement
AppendToNLSPath <template> Adds <template> to the end of the SET NLSPATH statement
RemoveFromPath <directory> Removes <directory> from the PATH statement
RemoveFromLibPath <directory> Removes <directory> from the LIBPATH statement
RemoveFromDPath <directory> Removes <directory> from the SET DPATH statement
RemoveFromHelp <directory> Removes <directory> from the SET HELP statement
RemoveFromBookshelf <directory> Removes <directory> from the SET BOOKSHELF statement
RemoveFromSomir <som file> Removes <som file> from the SET SOMIR statement
RemoveFromNLSPath <template> Removes <template> from the SET NLSPATH statement
InsertInLIB <directory> Inserts <directory> at beginning of the SET LIB statement
RemoveFromSetLIB <directory> Removes <directory> from the SET LIB statement
InsertInINCLUDE <directory> Inserts <directory> at beginning of the SET INCLUDE statement
RemoveFromINCLUDE <directory> Removes <directory> from the SET INCLUDE statement
AppendLine <line> Adds <line> to the end of the file
InsertLine <token> <line> Insert the new line before the line containing <token> with <line>. The matching of the token is done in a case-insensitive manner.
ReplaceLine <token> <line> Replace the entire line containing <token> with <line>. The matching of the token is done in a case-insensitive manner.
InsertSection <line> Insert all input from the queue before <line> until 'endSectionMarker' is read. The matching of the line is done in a case-insensitive manner.
AppendSection <line> Insert all input from the queue after <line> until 'endSectionMarker' is read. The matching of the line is done in a case-insensitive manner.
RemoveLine <token> Remove the line containing <token>. The matching of the token is done in a case-insensitive manner.
RemarkLine <token> Prepend 'REM' before the line containing <token>. The matching of the token is done in a case-insensitive manner.
AddLine <line number>, <line> Insert <line> before the current line at <line number>
DeleteLine <line number> Delete the line at <line number>
Set <var>=<value> Replace the current SET statement if any with a new SET statement. If there is not currently such a SET statement, append one to the end of the file.
WriteConfigFile Write the file out to disk.
exit Terminate processing and exit (or return if queueName = 'nul')

Note:

Many of these commands only make sense if the file is config.sys

EditFile uses the same queue interface as SetSetting. Do not mix calls to SetSetting with queue statements while using EditFile and EditConfigSys.

Last Modified: 21 Jul 2025
Graphics by Colorful Language
Copyright 2025 by Blonde Guy