Unix and Linux Discussions Tagged with for each |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
11,395 |
Programming |
|
|
|
4 |
3,896 |
Shell Programming and Scripting |
|
|
|
3 |
1,691 |
Shell Programming and Scripting |
|
|
|
41 |
13,620 |
Shell Programming and Scripting |
|
|
|
3 |
12,846 |
Programming |
|
|
|
0 |
955 |
UNIX and Linux RSS News |
|
|
|
3 |
18,997 |
AIX |
|
|
|
7 |
5,438 |
IP Networking |
|
|
|
9 |
6,988 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,105 |
Shell Programming and Scripting |
|
|
|
1 |
1,956 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
35,477 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
3,597 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,686 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
7,113 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
18,178 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
2,342 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
15,616 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
6,694 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
5,290 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
2,750 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
1 |
2,987 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,406 |
IP Networking |
|
|
|
1 |
3,117 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
15,519 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
60,769 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
5,772 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,590 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,747 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,614 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
6,548 |
IP Networking |
|
|
|
9 |
11,349 |
Cybersecurity |
|
|
|
3 |
29,186 |
Where do I download LINUX & UNIX? |
|
|
|
3 |
2,750 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,380 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
22,489 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,634 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,656 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,711 |
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)