*	file: URL support for CSNOBOL4 (and SPITBOL)
*	Phil Budne <phil@ultimate.com>
*	Oct 23, 1997
*	$Id: file.sno,v 1.2 2002-02-07 15:52:03 phil Exp $

	FILE.UNIT.TABLE = TABLE()

****************
*	FILE.OPEN()
*
*	args;
*	Name to associate for I/O
*	Filename (absolute?)
*	Mode args for INPUT()

	DEFINE("FILE.OPEN(FILE.NAME,FILE.FILE,FILE.MODE)FILE.UNIT")
+							:(FILE.OPEN.END)
FILE.OPEN
	DIFFER("FOO", .FOO)				:S(FILE.OPEN.SPITBOL)
	FILE.UNIT = IO_FINDUNIT()			:F(FRETURN)
	INPUT(FILE.NAME, FILE.UNIT, FILE.MODE, FILE.FILE) :F(FRETURN)
	FILE.UNIT.TABLE[FILE.NAME] = FILE.UNIT		:(RETURN)

* Here for spitbol;
FILE.OPEN.SPITBOL
	INPUT(FILE.NAME, FILE.NAME, FILE.FILE '[' FILE.MODE ']') :F(FRETURN)
	FILE.UNIT.TABLE[FILE.NAME] = FILE.NAME		:(RETURN)
FILE.OPEN.END

****************
*	FILE.CLOSE()
*
*	args;
*	Name associated for I/O

	DEFINE("FILE.CLOSE(FILE.NAME)")			:(FILE.CLOSE.END)
FILE.CLOSE
	DETACH(FILE.NAME)
	ENDFILE(FILE.UNIT.TABLE[FILE.NAME])		:(RETURN)
FILE.CLOSE.END
