eof



eof

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
SEE ALSO
KEYWORDS

___________________________

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(n), open(2), close(2), fblocked(n), Tcl_StandardChannels(3)

KEYWORDS

channel, end of file




More Linux Commands

manpages/pthread_yield.3.html
pthread_yield(3) - yield the processor - Linux manual page
pthread_yield() causes the calling thread to relinquish the CPU. The thread is placed at the end of the run queue for its static priority and another thread is

manpages/set_menu_userptr.3menu.html
set_menu_userptr(3menu) - associate application data with a
Every menu and every menu item has a field that can be used to hold application-specific data (that is, the menu-driver code leaves it alone). These functions g

manpages/rpms2solv.1.html
rpms2solv(1) convert one or more rpms into a solv file......
The rpms2solv tool converts the header data from one or more rpms into the solv file written to standard output. -m MANIFESTFILE Read the rpm file names from th

manpages/readahead.2.html
readahead(2) - perform file readahead into page cache.......
readahead() initiates readahead on a file so that subsequent reads from that file will be satisfied from the cache, and not block on disk I/O (assuming the read

manpages/mrtg-ipv6.1.html
mrtg-ipv6(1) IPv6 support in MRTG - Linux manual page.......
MRTG and cfgmaker support SNMP over IPv6. IPv6 targets can be specified by hostname or IPv6 address, and if the required libraries are present (see below), quer

manpages/snmpusm.1.html
snmpusm(1) - creates and maintains SNMPv3 users on a network
snmpusm is an SNMP application that can be used to do simple maintenance on the users known to an SNMP agent, by manipulating the agents User-based Security Mod

manpages/XGravityEvent.3.html
XGravityEvent(3) - GravityNotify event structure (Man Page)
The structure for GravityNotify events contains: typedef struct { int type; /* GravityNotify */ unsigned long serial; /* # of last request processed by server *

manpages/lremovexattr.2.html
lremovexattr(2) - remove an extended attribute (Man Page)...
Extended attributes are name:value pairs associated with inodes (files, directories, symbolic links, etc.). They are extensions to the normal attributes which a

manpages/addstr.3ncurses.html
addstr(3ncurses) - add a string of characters to a curses wi
These functions write the (null-terminated) character string str on the given window. It is similar to calling waddch once for each character in the string. The

manpages/getgrent_r.3.html
getgrent_r(3) - get group file entry reentrantly (Man Page)
The functions getgrent_r() and fgetgrent_r() are the reentrant versions of getgrent(3) and fgetgrent(3). The former reads the next group entry from the stream i

manpages/pesign-client.1.html
pesign-client(1) command line tool for signing UEFI applicat
pesign is a command line tool for manipulating signatures and cryptographic digests of UEFI applications. OPTIONS --unlock Unlock the specified token. A PIN - s

manpages/XCompositeRedirectWindow.3.html
XCompositeRedirectWindow(3) - X Composite Extension library
The composite extension provides several related mechanisms: Per-hierarchy storage The rendering of an entire hierarchy of windows is redirected to off-screen s





We can't live, work or learn in freedom unless the software we use is free.