home *** CD-ROM | disk | FTP | other *** search
-
-
- GetLength
- ~~~~~~~~~
-
- A small utility for the Shell
- By Diego Caravana
-
- Actual Version: 1.0
-
- ---
-
-
- 1. Legal Stuff
- ==============
-
- GetLength is placed in the Public Domain for the Amiga.
- No fee is requested to use it, nor anyone can ask anything for it
- (except for the media). Feel free to use it, but AT YOUR OWN RISK, as
- I cannot be considered responsible for any damage caused to your
- system. Have Fun!
-
-
- 2. What is it?
- ==============
-
- GetLength is a small utility that I have written mainly for me, but I
- think it can be very useful also for you. It is a Shell-only program
- and its work should be clear: it gets the length (in bytes) of the
- specified file and store it in an environment variable (either local
- or global) or prints it, enabling you to use it in your Shell scripts
- (or for what you want :) in a very simple way.
-
-
- 3. How to use
- =============
-
- It requires OS 2.04+.
- As said above, GetLength is a Shell-only program, so do not try to use
- from Workbench. It uses the standard parser of OS 2.x. Try to
- execute GetLength with a `?' as argument and you will get something
- like this:
-
- FILENAME/A,VAR=VARIABLE/K,GLOBAL/S,STDOUT/S
-
- Now, a little explanations of arguments:
-
- FILENAME/A here you MUST supply the file name whose you want
- know the length; if you do not do, there will be an
- error.
-
- VAR=VARIABLE/K is the name of the environment variable that will
- contain the input of the user; it must obey to the
- rules of DOS; the default is `GetLengthResult'.
- Do not mix with STDOUT keyword.
-
- GLOBAL/S if present , the variable will be global (setenv);
- the default is a local variable (set). Do not mix
- with STDOUT keyword.
-
- STDOUT/S if present, the resulting string will be printed
- in stdout (i.e. on the Shell you started
- GetLength) and not stored in any variable.
-
- The keywords above followed by `/K' MUST appear in the command line
- followed by their argument. Those followed by `/S' act like switches,
- i.e. if they appear, the corresponding feature will be enabled.
- Remember to use apices when necessary!
-
- A simple example of how to use GetLength is given below:
-
- ; stuff...
-
- GetLength MAIL:TrapDoor.log VAR tmpLen
- if $tmpLen GE 50000
- delete TrapDoor.log
- endif
-
- ; or even...
-
- if `GetLength MAIL:TrapDoor.log STDOUT` GE 50000
- delete TrapDoor.log
- endif
-
- ; even more stuff...
-
- Note that above in the first GetLength line, you must NOT include the
- `$' sign before the variable name! Once more, note the use of
- backquote (a new 2.0+ feature!) in the second GetLength line: it
- means that what will be printed by the `backquoted' command, will
- became a parameter for if (in this case) and will be no more printed.
-
- As you can see, GetLength can be useful for treating files which tend
- to became larger and larger, allowing to automatize a job that
- frequently is done manually. Utilities like mine exist, but they are
- constructed on a time base (do this every hour, week, etc.) instead of
- on a length base, which I think is better and more precise.
-
-
- 4. The Language
- ===============
-
- I have used E language to write GetLength. What? E ?! Yea! Go and
- see the source !!! :-)
- But Why? Because it is a very powerful simple-to-use language
- dedicated explicitly to our Amiga, influenced by C and Modula-2, so
- you can imagine its power. It offers an incredibly vast number of
- features, like high speed in compiling, extremely compact executables,
- inline assembly, direct access to Amiga Shared Libraries, powerful
- type system, exception handling, etc.
-
- Cool, eh? Try it, if you do not believe to your eyes ! :-)
- The author of E language is:
-
- Wouter van Oortmerssen ($#%!)
- Levendaal 87
- 2311 JG Leiden
- HOLLAND
-
- If you have access to Email:
-
- Wouter@alf.let.uva.nl (E-programming support)
- or: Wouter@mars.let.uva.nl (personal)
- or: Oortmers@gene.fwi.uva.nl (other)
-
-
- 5. The Author
- =============
-
- If you want to send me bug-reports or a time-bomb *:), I can be
- contacted in the following manners:
-
- by snail-mail
-
- Diego Caravana
-
- V. Liguria, 24
- 10071 Borgaro (TO)
- Italy
-
- by e-mail
-
- `Diego Caravana' on
-
- FIDO 2:334/308
- 2:334/308.9
- AMIGANET 39:101/3
-
- Internet Diego.Caravana%bbs@osra.sublink.org
-
- To find me and the E language stuff, you can call the BBS on which I
- am CoSysOp (located in Turin, Italy):
-
- *The New ATH*
- ~~~~~~~~~~~
- TEL +39-11-5629284
- +39-11-5629290
- FIDO 2:334/308
- AMIGANET 39:101/3
- Internet <soon>
-
-
-