Unix and Linux Discussions Tagged with for each |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
11,421 |
Programming |
|
|
|
4 |
3,906 |
Shell Programming and Scripting |
|
|
|
3 |
1,699 |
Shell Programming and Scripting |
|
|
|
41 |
13,639 |
Shell Programming and Scripting |
|
|
|
3 |
13,043 |
Programming |
|
|
|
0 |
956 |
UNIX and Linux RSS News |
|
|
|
3 |
19,015 |
AIX |
|
|
|
7 |
5,490 |
IP Networking |
|
|
|
9 |
7,069 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,144 |
Shell Programming and Scripting |
|
|
|
1 |
1,973 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
35,600 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
3,616 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,718 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
7,144 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
18,211 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
2,378 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
15,671 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
6,742 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
5,319 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
2,793 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
1 |
3,008 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,426 |
IP Networking |
|
|
|
1 |
3,142 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
15,573 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
60,831 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
5,809 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,632 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,806 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,638 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
6,582 |
IP Networking |
|
|
|
9 |
11,424 |
Cybersecurity |
|
|
|
3 |
29,232 |
Where do I download LINUX & UNIX? |
|
|
|
3 |
2,788 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,407 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
22,521 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,655 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,687 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,744 |
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)