-----------------------------------------------------------
	ADIR	version 0.2b		14 November 1996
		Sameer Kalidas
-----------------------------------------------------------

CONTENTS	About
		Syntax
		Format String
		Examples
		Distribution and Disclaimer
		Contacting the author
		History


ABOUT		Adir is a directory listing program similar to MSDOS's dir.
		But Adir gives you full control on how the directories are
		listed. It does this through the use of format strings, which
		can contain simple text ,variables or functions. Here is a
		simple example :

		adir32 /b /F "!ifeq('#e' '.txt' '#f is a text file' '#F' )\n"

		.
		..
		ADIR.C
		ADIR16.EXE
		adir32.exe
		ReadMe is a text file


SYNTAX		ADIR[16/32] [/D] [[/r]|[/f]] [/b] [/w] [[/F "string"]|
			[/F@ "filename"]] [path[path[...]]]

		ADIR16	16bit version for MSDOS and Windows 3.xx.
		ADIR32	32bit version for Windows 95 and Windows NT.
			Same as ADIR16 execept handles long filenames.

		Options - The following options can be given :

		/D	Do not display directories '.' and '..'.
		/r	Recursively enter into directories.
			Can not be used with /f option.
		/f	Find mode. Searches directories recusively for
			given filename.
		  	Can not be used with option /r.
		/b	Bare format does not display header or footer.


		Formatting

		/F "string"	Format directory entries using string.
		/F@ "filename"	Format directory entries using string stored
				in file filename.


FORMAT STRING

	A format string contains text that will be displayed for each diretory
	entry. There are some special characters which do other things, these
	are :

	!function_name( 'arg1' 'arg2' 'arg3' ... )

	The character '!' tells adir that the following is a function call to
	function function_name with arguments arg1, arg2, arg3 etc...
	The arguments must be enclosed in apostraphes, anything outside
	will be ignored. An argument can contain whatever a format string
	can contain. The function_name starts after the '!' up to the '('.
	The available functions are :

		ctime -	Outputs creation time of file using arg1 to describe
			how it will be displayed. Note this is the same as
			Borlands runtime library function ctime.
			Here is list of valid characters for arg1 :

			%%	Character %
			%a	Abbreviated weekday name
			%A	Full weekday name
			%b	Abbreviated month name
			%B	Full month name
			%c	Date and time
			%d	Two-digit day of month (01 - 31)
			%H	Two-digit hour (00 - 23)
			%I	Two-digit hour (01 - 12)
			%j	Three-digit day of year (001 - 366)
			%m	Two-digit month as a decimal number (1 - 12)
			%M	2-digit minute (00 - 59)
			%p	AM or PM
			%S	Two-digit second (00 - 59)
			%U	Two-digit week number where Sunday is the first
				day of the week (00 - 53)
			%w	Weekday where 0 is Sunday (0 - 6)
			%W	Two-digit week number where Monday is the first
				day of week the week (00 - 53)
			%x	Date
			%X	Time
			%y	Two-digit year without century (00 to 99)
			%Y	Year with century
			%Z	Time zone name, or no characters if no time zone

 		ifdir -	Outputs arg1 if file is a directory else outputs arg2.

		ifeq  -	If arg1 = arg2 then outputs arg3 else arg4.


	#[-][width]varible_name

	Outputs varible varible_name.
	Varible_name is one of the following :

		s	file size
		v	drive letter
		d	directory path
		f	filename without '.' and extension
		e 	'.' and extension
		F	full filename
		P	full path ie drive, directory path, filename
		D	directory path with drive letter
		V	same as D but with trailing \
		r	relative directory, ie directory path without
			the current working directory path

	\character

	Quotes character ie prevents it from being used for anything else.
	character is one of the following:

		n	newline
		t	tab
		\	output backslash
		'       astrophe

	NOTE: As of version 0.2b a newline is not automaticaly appended
		to the end of a format string.


EXAMPLES

	Simple use of varibles, #P displays the full path of each file.
	Remember to add a newline character, as adir does not.

	F:\ADIR>adir32 /b /F "#P\n"
	
	F:\ADIR\.
	F:\ADIR\..
	F:\ADIR\ADIR.C
	F:\ADIR\ADIR16.EXE
	F:\ADIR\adir32.exe
	F:\ADIR\ReadMe.txt

	The following format string calls function ifeq to test the extension
	of each filename if 1st and 2nd arguments are equal then it displays
	the 3rd argument else the 4th argument. Note you can use all the
	features of a format string in an argument.

	F:\ADIR>adir32 /b /F "!ifeq('#e' '.txt' '#f is a text file' '#F' )\n"

	.
	..
	ADIR.C
	ADIR16.EXE
	adir32.exe
	ReadMe is a text file

	The following demonstrates ctime. For some reason % characters cause
	problems when used on the command line so I create a file which
	contains the format string. Test.txt contains the following :

	#F\t\t!ctime( '%x %X %d-%m-%y' )\n

	Note, for the ctime argument you can only use the characters described
	above for using the ctime function. The command line goes like this :

	F:\ADIR>adir32 /b /F@ "test.txt"

	.               Wed Oct 23 21:13:24 23-10-96
	..              Wed Oct 23 21:13:24 23-10-96
	ADIR.C          Sat May 04 23:58:58 04-05-96
	ADIR16.EXE              Sun May 05 00:03:16 05-05-96
	adir32.exe              Sun May 05 00:03:26 05-05-96
	test.txt                Mon Nov 11 00:12:06 11-11-96
	ReadMe.txt              Sat May 04 23:52:56 04-05-96


DISTRIBUTION AND DISCLAIMER

	This program may be used in any way, for any purpose, at
	no cost. It may be distributed by any means, provided that
	the original files as supplied by the author remain intact.

	You do not need to register to use this program, or buy a
	licence.

	This program may be placed on any archive or BBS system.

	This program can not be bundled with any commercial package
	or distributed by itself without express written permission
	from the author.

	The author of this program accepts no responsibility for 
	damages resulting from the use of this product and makes no 
	warranty or representation, either express or implied,
	including but not limited to, any implied warranty of
	merchantability or  fitness for a particular purpose. This
	software is provided  "AS IS", and you, its user, assume
	all risks when using it.

	By installing this program you implicitly agree to the
	rules outlined above.


CONTACTING THE AUTHOR

	Email:	sameerk@ihug.co.nz
	Web:	http://crash.ihug.co.nz/~sameerk


HISTORY

	version 0.1
		- adir is born.


	version 0.2		21 January 1996
		- fixed bug when parsing adir arguments.
		  Anything not starting with a / was thought to be a path.
		- improved documentation. see above.
		- compiled for win32 console. Under Windows 95 displays
		  long filenames.
		- increased stack size from 20k to 100k.


	version 0.2b	 	5 may 1996
		- fixed many bugs:
			- quoted characters not getting quoted.
			- function handling errors.
			- output is nicer.
			- and many more..
		- added new relative path.
		- removed automatic appending of newlines to format strings.
		- removed wide format.

