foreach

Unfortunately I no longer have the time or resources to provide any support or updates to foreach.

foreach read me
version 1.2
april 2000

see foreach.txt for syntax and examples

about this program

foreach is a program i wrote for myself initially to compact a large
quantity of files in many directories into their own .arj files.  i added
a bit more functionality as time went on, and i found myself using the
program more and more in day-to-day use, so i thought other people might
find it useful.  i tidied the program up and released it.

the program was written in turbo pascal 7, and if you want the source
code you're welcome to email me at my email address below.

foreach is released as public domain.  you copy and use this program
without restriction under the condition you distribute readme.txt and
foreach.txt with foreach.exe.  i will not accept responsibility for
damages caused directly or indirectly through use of this program.

about the author

byron jones
system administrator - vianet australia

exit codes

these exit codes are most useful with -Q mode enalbed.

0   no error
1   program terminated by user
2   no matching files

parameter errors

10  not enough parameters
11  invalid parameter
12  no command specified
13  no matching files
14  invalid pad length

command errors

20  couldn't execute command

file errors

30  invalid list file
31  unable to open list file
32  couldn't create temp file

misc errors

255 unable to open help (compilation error)

change log

1.2

    new features

    - added interactive mode -i : prompts for processing of each file
    - added ultra quiet mode -Q : supresses all foreach output
    - added exit codes for error messages

    bug fixes

    - redesigned internal help - now faster and smaller code
    - attributes for each file now correctly gathered
    - redesigned and tidied code a little

1.1

    new features

    - options and commands are now case sensitive
    - added -D : only list directories
    - added -h : include hidden files
    - changed $t to $D, $m to $M and $y to $Y
    - added $y : date in yy format
    - added random characters $r and random numbers $R
    - allows unix-style grouped parameters ie -rvp2d

    bug fixes

    - redirects stdin to a temp file so stdin isn't read by programs
    that foreach runs
    - fixed bug stopping it from opening read-only listfiles
    - fixed bug stopping listfiles to be processed under some conditions
    - better handling of command line parameters

1.0

    new features

    - added this file :)
    - added day, month and year ($t $m $y) - $t = today
    - added switch to read from stdin
    - added invalid parameter errors instead of just showing help
    - added test mode -t : displays commands that would be run, but doesn't
    actually run them
    - expands unspecified names and extensions to wildcards
        eg filename -> filename.*
    - expands directories passed as filespec (treats as all files in dir)
        eg c:\dos -> c:\dos\*.*

    bug fixes

    - fixed alpha counter - won't crash with > 26 files
    - better parameter checking
    - much improved handling of $; and $$
    - correctly handles listfiles with full paths

1.0 beta

    - first public release
    - tidied and commented code
    - added ability to include file redirection in command line ($t $g $p)

1.0 alpha

    - non-public

Download