{jfileio.tcl
Introduction
The jfileio.tcl library is distributed as part of the jstools package.  It consists of two procedures that slightly simplify file access.

This document describes jfileio.tcl version 2001.02.10.
Usage
Accessing the Library
In order to use the jfileio.tcl library, it must be in your Tcl auto_path, described in tclvars(n).  Information about how to arrange that, and other conventions common to the jstools libraries, is in the Usage section of The jstools Libraries.
Credits and Copyright
Author
Jay Sekora 
js@aq.org
http://www.aq.org/~js/
Copyright
The library is copyright © 1992-2001by Jay Sekora, but may be freely redistributed under the conditions at the top of the file.
Overview
Procedures
::jstools::write_file - write given text to a file
::jstools::read_file - return contents of file
::jstools::write_file
Usage
	::jstools::write_file filename text
Arguments
	filename is the name of the file to open for writing
	text is the string to store in filename
Description
This procedure writes the string text to the file named file.  If the file can not be opened for writing, an error will occur (invoking the Tk procedure tkerror(n))  The previous contents of file, if any, will be overwritten.  No additional newline is appended to text.
::jstools::read_file
Usage
	::jstools::read_file file
Arguments
	file is the name of the file to open for reading
Description
This procedure returns the contents of the file named file.  If the file can not be opened for reading, an error will occur (invoking the Tk procedure tkerror(n))
Future Directions
· A procedure to append text to a file might be useful.
· It might be nice to catch errors, figure out what caused them, and display more informative error messages, or even give the user the opportunity to create missing directories or change permissions on files sie owns.
} {{{list:level:1 {36.0 38.0}} {jhtml:anchor:anchorname {20.0 21.0 28.0 29.0}} {jdoc:anchor:anchorname {2.0 3.0 6.0 7.0 9.0 10.0 16.0 17.0 20.0 21.0 28.0 29.0}} {jdoc:xref:link {3.54 3.61 8.172 8.193 8.201 8.218 8.222 8.243 18.0 18.21 19.0 19.20}} {jdoc:xref:manpage {8.88 8.95 27.153 27.160 34.151 34.158}} {richtext:font:roman {3.0 3.4 3.15 3.54 3.61 5.24 5.35 6.0 8.0 8.20 8.31 8.64 8.73 8.88 8.95 8.176 8.183 8.205 8.210 8.222 8.243 9.0 11.0 12.0 12.9 13.0 13.22 14.0 15.0 16.0 18.21 19.0 19.20 20.0 22.36 23.0 24.9 25.1 25.5 25.32 25.40 26.0 27.0 27.33 27.37 27.56 27.60 27.153 27.160 27.191 27.195 27.264 27.268 28.0 30.26 31.0 32.5 33.0 34.0 34.54 34.58 34.151 34.158 35.0 36.0 38.0}} {richtext:font:italic {22.23 22.31 22.32 22.36 24.1 24.9 25.1 25.5 25.32 25.40 27.33 27.37 27.56 27.60 27.191 27.195 27.264 27.268 30.22 30.26 32.1 32.5 34.54 34.58}} {richtext:font:bold {3.4 3.15 3.54 3.61 5.24 5.35 8.20 8.31 8.176 8.183}} {richtext:font:bolditalic {8.205 8.210 8.222 8.243}} {richtext:font:typewriter {8.64 8.73 8.88 8.95 12.0 12.9 13.0 13.22 18.0 18.21 19.0 19.20 22.0 22.23 22.31 22.32 24.0 24.1 27.153 27.160 30.0 30.22 32.0 32.1 34.151 34.158}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {2.0 3.0 6.0 7.0 9.0 10.0 16.0 17.0 20.0 21.0 28.0 29.0 35.0 36.0}} {richtext:font:heading2 {7.0 8.0 10.0 11.0 14.0 15.0 17.0 18.0 21.0 22.0 23.0 24.0 26.0 27.0 29.0 30.0 31.0 32.0 33.0 34.0}} {{} {9.0 15.0 17.0 18.0 20.0 22.22 22.36 24.1 25.40 26.0 27.0 27.14 27.269 30.1 30.26 32.1 32.49 34.0}} {jdoc:link:jstools.jdoc {3.54 3.61}} {jdoc:manpage:tclvars {8.88 8.95}} {jdoc:link:jslibraries.jdoc#Usage {8.201 8.218}} {jdoc:link:jslibraries.jdoc {8.222 8.243}} {jdoc:anchorname:Credits_and_Copyright {9.0 10.0}} {jdoc:anchorname:Introduction {2.0 3.0}} {jdoc:anchorname:Usage {6.0 7.0}} {jdoc:link:jslibraries.tcl {8.172 8.193}} {jdoc:anchorname:Overview {16.0 17.0}} {jdoc:manpage:tkerror {27.153 27.160 34.151 34.158}} {jdoc:anchorname:j:fileio:write {20.0 21.0}} {jdoc:anchorname:j:fileio:read {28.0 29.0}} {list:1:ul {36.0 38.0}} {jdoc:link:#::jstools::write_file {18.0 18.21}} {jdoc:link:#::jstools::read_file {19.0 19.20}} {jhtml:anchorname:::jstools::write_file {20.0 21.0}} {jhtml:anchorname:::jstools::read_file {28.0 29.0}} {special:list_item:1 {36.0 36.1 37.0 37.1}}} {{abbrevstart 37.2} {matchend 38.0} {del_from 38.0} {abbrevend 37.2} {insert 5.54} {insert_save 37.6} {emacs_mark 38.0} {anchor 5.54} {matchstart 38.0} {del_to 38.0} {current 25.36}}} {{body_alink #ff0000} {body_vlink #000080} {body_link #0000ff} {body_text #000000} {body_bgcolor #ffffff}}