File: xclose.awk

package info (click to toggle)
runawk 1.6.0-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 808 kB
  • ctags: 207
  • sloc: awk: 1,127; ansic: 736; sh: 421; makefile: 103
file content (24 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Written by Aleksey Cheusov <vle@gmx.net>, public domain
#
# This awk module is a part of RunAWK distribution,
#        http://sourceforge.net/projects/runawk
#    
############################################################

# =head2 xclose.awk
#
# =over 2
#
# =item I<xclose(FILE)>
#
# safe wrapper for 'close'.
# awk exits with error if close() function failed.
#
# =back
#

#use "alt_assert.awk"

function xclose (fn){
	assert(close(fn) == 0, "close(\"" fn "\") failed")
}