Unix and Linux Discussions Tagged with for each |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
0 |
11,205 |
Programming |
|
|
|
4 |
3,833 |
Shell Programming and Scripting |
|
|
|
3 |
1,610 |
Shell Programming and Scripting |
|
|
|
41 |
13,417 |
Shell Programming and Scripting |
|
|
|
3 |
12,000 |
Programming |
|
|
|
0 |
932 |
UNIX and Linux RSS News |
|
|
|
3 |
18,843 |
AIX |
|
|
|
7 |
5,034 |
IP Networking |
|
|
|
9 |
6,628 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
8,693 |
Shell Programming and Scripting |
|
|
|
1 |
1,898 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
34,694 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
3,430 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,557 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
6,928 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
18,058 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
2,213 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
15,116 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
6,348 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
5,087 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
2,543 |
Post Here to Contact Site Administrators and Moderators |
|
|
|
1 |
2,803 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,266 |
IP Networking |
|
|
|
1 |
2,943 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
15,240 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
60,413 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
5,520 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
9,366 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,508 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,498 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
6,312 |
IP Networking |
|
|
|
9 |
10,884 |
Cybersecurity |
|
|
|
3 |
28,917 |
Where do I download LINUX & UNIX? |
|
|
|
3 |
2,523 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,208 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
22,324 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,474 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,529 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,537 |
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)