# fileLib.tcl
#   File I/O routines

proc writefile { filename data } {
        set filename $filename
        set fileID [open $filename "w"]
        puts $fileID $data
        close $fileID
}

proc readfile { filename } {
        set fileID [open $filename "r"]
        gets $fileID data
        close $fileID
        return $data
}

proc readEntireFile {filename } {
        set fileID [open $filename "r"]
        set data [read $fileID] 
        close $fileID
        return $data
}