{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 4.0/4.0.

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@calumet.org
http://shore.net/~js/

Copyright
The library is copyright © 1992-1995 by Jay Sekora, but may be freely redistributed under the conditions at the top of the file.

Overview
Procedures
j:fileio:write - write given text to a file
j:fileio:read - return contents of file

j:fileio:write
Usage
	j:fileio:write 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.

j:fileio:read
Usage
	j:fileio:read 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.

} {{{jdoc:xref:link {4.54 4.61 10.172 10.193 10.201 10.218 10.222 10.243 23.0 23.14 24.0 24.13}} {jdoc:xref:manpage {10.88 10.95 36.153 36.160 46.151 46.158}} {jdoc:anchor:anchorname {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 26.0 27.0 38.0 39.0}} {richtext:font:roman {2.0 3.0 4.0 4.4 4.15 4.54 4.61 6.24 6.35 8.0 10.0 10.20 10.31 10.64 10.73 10.88 10.95 10.176 10.183 10.205 10.210 10.222 10.243 12.0 14.0 15.0 15.14 16.0 16.21 18.0 19.0 21.0 23.14 24.0 24.13 26.0 28.29 30.0 31.9 32.1 32.5 32.32 32.40 35.0 36.0 36.33 36.37 36.56 36.60 36.153 36.160 36.191 36.195 36.264 36.268 38.0 40.19 42.0 43.5 45.0 46.0 46.54 46.58 46.151 46.158 48.0 49.0 52.0}} {richtext:font:italic {28.16 28.24 28.25 28.29 31.1 31.9 32.1 32.5 32.32 32.40 36.33 36.37 36.56 36.60 36.191 36.195 36.264 36.268 40.15 40.19 43.1 43.5 46.54 46.58}} {richtext:font:bold {4.4 4.15 4.54 4.61 6.24 6.35 10.20 10.31 10.176 10.183}} {richtext:font:bolditalic {10.205 10.210 10.222 10.243}} {richtext:font:typewriter {10.64 10.73 10.88 10.95 15.0 15.14 16.0 16.21 23.0 23.14 24.0 24.13 28.0 28.16 28.24 28.25 31.0 31.1 36.153 36.160 40.0 40.15 43.0 43.1 46.151 46.158}} {richtext:font:heading0 {1.0 2.0}} {richtext:font:heading1 {3.0 4.0 8.0 9.0 12.0 13.0 21.0 22.0 26.0 27.0 38.0 39.0 48.0 49.0}} {richtext:font:heading2 {9.0 10.0 13.0 14.0 18.0 19.0 22.0 23.0 27.0 28.0 30.0 31.0 35.0 36.0 39.0 40.0 42.0 43.0 45.0 46.0}} {{} {11.0 19.0 22.0 23.0 26.0 26.2 26.14 28.3 28.29 31.1 32.40 34.0 36.0 36.14 36.269 38.2 38.13 40.1 40.19 43.1 43.49 46.0 47.0 48.0}} {jdoc:link:jstools.jdoc {4.54 4.61}} {jdoc:manpage:tclvars {10.88 10.95}} {jdoc:link:jslibraries.jdoc#Usage {10.201 10.218}} {jdoc:link:jslibraries.jdoc {10.222 10.243}} {jdoc:anchorname:Credits_and_Copyright {12.0 13.0}} {jdoc:anchorname:Introduction {3.0 4.0}} {jdoc:anchorname:Usage {8.0 9.0}} {jdoc:link:jslibraries.tcl {10.172 10.193}} {jdoc:anchorname:Overview {21.0 22.0}} {jdoc:link:#j:fileio:write {23.0 23.14}} {jdoc:link:#j:fileio:read {24.0 24.13}} {jdoc:manpage:tkerror {36.153 36.160 46.151 46.158}} {jdoc:anchorname:j:fileio:write {26.0 27.0}} {jdoc:anchorname:j:fileio:read {38.0 39.0}}} {{abbrevstart 51.2} {matchend 52.0} {del_from 52.0} {abbrevend 51.2} {insert 1.0} {emacs_mark 52.0} {anchor 1.0} {matchstart 52.0} {del_to 52.0} {current 1.0}}}