Unix and Linux Discussions Tagged with for each |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
11,370 |
Programming |
|
|
|
4 |
3,886 |
Shell Programming and Scripting |
|
|
|
3 |
1,684 |
Shell Programming and Scripting |
|
|
|
41 |
13,594 |
Shell Programming and Scripting |
|
|
|
3 |
12,737 |
Programming |
|
|
|
0 |
953 |
UNIX and Linux RSS News |
|
|
|
3 |
18,969 |
AIX |
|
|
|
7 |
5,388 |
IP Networking |
|
|
|
9 |
6,931 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,067 |
Shell Programming and Scripting |
|
|
|
1 |
1,944 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
35,380 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
3,574 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,668 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
7,086 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
18,160 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
2,322 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
15,554 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
6,650 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
5,253 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
2,731 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
1 |
2,953 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,384 |
IP Networking |
|
|
|
1 |
3,097 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
15,480 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
60,709 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
5,721 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,558 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,715 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,595 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
6,524 |
IP Networking |
|
|
|
9 |
11,284 |
Cybersecurity |
|
|
|
3 |
29,146 |
Where do I download LINUX & UNIX? |
|
|
|
3 |
2,720 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,361 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
22,461 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,619 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,640 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,683 |
UNIX for Dummies Questions & Answers |
eof(3tcl) Tcl Built-In Commands eof(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
eof - Check for end of file condition on channel
SYNOPSIS
eof channelId
_________________________________________________________________
DESCRIPTION
Returns 1 if an end of file condition occurred during the most recent input operation on channelId (such as gets), 0 otherwise.
ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdin, stdout, or stderr), the return value from an
invocation of open or socket, or the result of a channel creation command provided by a Tcl extension.
EXAMPLES
Read and print out the contents of a file line-by-line:
set f [open somefile.txt]
while {1} {
set line [gets $f]
if {[eof $f]} {
close $f
break
}
puts "Read line: $line"
}
Read and print out the contents of a file by fixed-size records:
set f [open somefile.dat]
fconfigure $f -translation binary
set recordSize 40
while {1} {
set record [read $f $recordSize]
if {[eof $f]} {
close $f
break
}
puts "Read record: $record"
}
SEE ALSO
file(3tcl), open(3tcl), close(3tcl), fblocked(3tcl), Tcl_StandardChannels(3tcl)
KEYWORDS
channel, end of file
Tcl 7.5 eof(3tcl)