File: read_file.tcl

package info (click to toggle)
libapache2-mod-rivet 2.3.3-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 5,156 kB
  • ctags: 1,093
  • sloc: xml: 7,696; tcl: 6,939; ansic: 5,682; sh: 4,862; makefile: 199; sql: 91; lisp: 78
file content (20 lines) | stat: -rw-r--r-- 359 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
###
## read_file <file>
##    Read the entire contents of a file and return it as a string.
##
##    file - Name of the file to read.
##
## $Id: read_file.tcl 1212149 2011-12-08 21:57:35Z mxmanghi $
##
###

namespace eval ::rivet {

    proc read_file {file} {
        set fp [open $file]
        set x [read $fp]
        close $fp
        return $x
    }

}