Debian Codegraph @

testsuite/modulefiles/puts/8

raw
1 #%Module1.0
2
3 ##############################################################################
4 # Modules Revision 3.0
5 # Providing a flexible user environment
6 #
7 # File: puts/%M%
8 # Revision: %I%
9 # First Edition: 2018/03/01
10 # Last Mod.: %U%, %G%
11 #
12 # Authors: Xavier Delaruelle, [email protected]
13 #
14 # Description: Testuite modulefile
15 # Command:
16 # Sub-Command: puts
17 #
18 # Invocation: load @M@
19 # Result: %R{
20 # }R%
21 # Comment: %C{
22 # Check the 'puts' command
23 # }C%
24 #
25 ##############################################################################
26
27 if {[module-info mode "load"]} {
28 set fname [file join $::env(TESTSUITEDIR) "puts"]
29
30 # write to test file with puts command
31 set fid [open $fname w]
32 puts -nonewline $fid "textout1"
33 puts $fid "textout2"
34 puts -nonewline $fid "textout3"
35 close $fid
36
37 # read what has been written
38 set fid [open $fname r]
39 puts [read $fid]
40 close $fid
41 }
42 setenv testsuite ok