home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
534.lha
/
ENV-handler_v2.5
/
ENV.doc
< prev
next >
Wrap
Text File
|
1991-08-08
|
4KB
|
84 lines
ENV-handler and associated files are © 1991 by Mike Ruble. Any inquiries or
problems should be sent EMAIL CompuServe ID 71310,1237.
The Environment Variable handler is an AmigaDOS handler that manages all
variables in memory instead of in separate files on disk. The way that
Commodre implemented environment variables requires you to create a separate
directory somewhere on your disk and create files with the name of your
variables. I always thought that this was STUPID and a waste of disk
space. So I (finally) wrote ENV-handler to store all variables in a single
file that you can specify in its MountList entry. When you Mount ENV: the
handler will read this file (if it exists) and set up its own variable list.
Each time a variable is updated, added, renamed, or deleted the file will be
updated so that variables will become permanent until you delete them.
ENV: also supports sub-directories. You can create a sub-directory using
the AmigaDOS MakeDir command. This was added to support the OS2.0 "sys"
sub-directory. ENV: will support any number of nested sub-directories.
I have also added support for temporary variables (which will not survive
a system re-boot). By creating the variable with a prefix of 'temp/'
(e.g. temp/TempVar) it will not be added to the file and will have to be
re-created when you boot your system.
To install ENV-handler in your system copy the file 'ENV-handler' to your
L: directory and add the following to your 'DEVS:MountList' file
ENV: Handler = L:ENV-handler
Startup = "DEVS:envfile" /* put whatever filename you want here */
Stacksize = 4000
Priority = 5
GlobVec = -1
Mount = 1 /* OPTIONAL */
#
then somewhere in your 'S:Startup-Sequence' file put the command
'Mount ENV:' and your all set.
ENV: will work much like the Commodore implementation of the 'ENV:'
directory. You can use many of the DOS commands that you would use on
files (Dir, List, Copy, Delete, Rename, etc) you can edit variables with
your favourite editor (my editor works anyway) You can even CD to ENV:.
One thing about Copying a file to a variable, you may get an error message
telling you that the date and/or comment could not be changed, this is normal
because date changes and comments are not supported (or neccesary).
Variable names are not case sensitive (because of Commodore) so 'Var'
will be the same as 'var' or 'VAR' etc.
The file maintained by ENV: has a specific format. Be VERY carefull if
you make any changes to it. The first 4 characters may look wierd because
they indicate the length of the variable that follows (name=value). So an
example of the file format is
00 00 00 0a name=value00 00 00 0c name2=value2
| |
10 12
if the length is incorrect the results could be disasterous. This file is
updated any time a non-temporary variable is added, changed, deleted, etc.
This is my first attempt at writing an AmigaDOS handler so don't erase
your ENV directory until you are satisfied that ENV-handler performs
properly. I have tried to break it in several ways and it seems quite
stable to me. ENV: runs under V1.3 of AmigaDOS. I don't know about V1.2 or
V2.0 (I don't have them) try it and let me know please.
Enjoy
Mike Ruble
CompuServe ID 71310,1237
CHANGES:
V2.5 05/21/91 - MWR - Added support for sub-directories. cleaned up some
code to make a little faster.
V2.0 05/04/91 - MWR - Re-coded in assembler to reduce size and
increase speed. fixed a bug found when creating
or writing to variables.
V1.3 05/02/91 - MWR - Removed ' (temp)' tag on temporary variables.
I decided it wasn't necessary.
V1.1 04/23/91 - MWR - Added support for temp variables. Stomped on
bug found when using type.
V1.0 04/21/91 - MWR - New program.