eof(n) Tcl Built-In Commands eof(n)
__________________________________________________________________________________________________________________________________________________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.
SEE ALSO
file(n), open(n), close(n), fblocked(n), Tcl_StandardChannels(3)KEYWORDS
channel, end of file
Tcl 7.5 eof(n)
Check Out this Related Man Page
close(n) Tcl Built-In Commands close(n)
__________________________________________________________________________________________________________________________________________________NAME
close - Close an open channel.
SYNOPSIS
close channelId
_________________________________________________________________DESCRIPTION
Closes the channel given by channelId.
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.
All buffered output is flushed to the channel's output device, any buffered input is discarded, the underlying file or device is closed,
and channelId becomes unavailable for use.
If the channel is blocking, the command does not return until all output is flushed. If the channel is nonblocking and there is unflushed |
output, the channel remains open and the command returns immediately; output will be flushed in the background and the channel will be |
closed when all the flushing is complete.
If channelId is a blocking channel for a command pipeline then close waits for the child processes to complete.
If the channel is shared between interpreters, then close makes channelId unavailable in the invoking interpreter but has no other effect |
until all of the sharing interpreters have closed the channel. When the last interpreter in which the channel is registered invokes close, |
the cleanup actions described above occur. See the interp command for a description of channel sharing. |
Channels are automatically closed when an interpreter is destroyed and when the process exits. Channels are switched to blocking mode, to |
ensure that all output is correctly flushed before the process exits.
The command returns an empty string, and may generate an error if an error occurs while flushing output.
SEE ALSO
file(n), open(n), socket(n), eof(n), Tcl_StandardChannels(3)KEYWORDS
blocking, channel, close, nonblocking
Tcl 7.5 close(n)
This goes deeper into the date thing. I want to be able to check the date and time stamp in or on a file to see what the time span is.
We have a job that runs several times an hour - kicked off through cron based on a trigger file. We want to keep track of each run and check the time between... (14 Replies)
Newbie question. I want to create a shell script that will only move/copy a file if it's determined that the eof string exists. This is to control files being uploaded via FTP. I don't want to move incomplete files, so my only thought is to check for eof, or compare file size every 15-30 seconds on... (12 Replies)
How to check for a premature EOF in a regular file in a shell/perl script?
I want to check if I have received a complete file or not.
Thanks,
Rahul. (12 Replies)
I ran the following scripts and everytime i get the errot as follows
Line 54: unexpected EOF while looking for matching ','
line 57 syntex error unexpected end of file#!/bin/ksh
set -x
BKUP_DIR=/u03/backups/abu/nightly_backup
LOG_FILE=/u03/backups/abu/backup.log
ORACLE_HOME=... (9 Replies)
Hi,
I am practicing exercise programs with System calls.
Exercise Question: write a pogram to accept a filename from the user. The program should write ecery fifth byte of the file to the standard output.
My Program :
# include <stdio.h>
# include <fcntl.h>
# include <error.h>
... (10 Replies)
Hi all,
I just wrote a small problem to check gettimeofday in a multi-cores environment.
int timediff(double fTimeQvs, double fTimeTcp)
{
int iTimeDiff;
iTimeDiff = (((((int)fTimeQvs)/10000) - (((int)fTimeTcp)/10000)) * 3600) * 1000000;
iTimeDiff +=... (17 Replies)
Hi All,
is it possible to find out the size of an array of structures ( without using 'sizeof' operator). The condition is we have the array of structure instant but we are not aware of the elements inside the structure.
Can someone help me out?
Thanks in advance. (18 Replies)
Hi
I have a requirement to process number of files matching a criteria. The resulted file would be processed indivdually looking for a particular string until another one found lines afterwards. Then look for the occurrence of another string in the result count and display/return the result. ... (13 Replies)
I'm a complete UNIX newbie trying to write a simple shell script. The pseudo-code for the part I'm having trouble with is as such:
read something
while ; do this
The loop terminates at EOF (like when Ctrl+D is pushed) and displays the number of lines the user entered (kept in the loop as a... (17 Replies)
Hi,
i have a script as below.
i'm using sun solaris 10.
Script :
#! /bin/sh
load() {
find /stage_area/loadfiles/telsims/test/ -type f -name "*$1" -print > /tmp/testfile.txt
fc=`cat /tmp/testfile.txt | wc -l | sed 's/ //g'`
if ; then
echo " Files Not Avaliable"
exit
else... (12 Replies)
i'm writing a bash script that uploads a file to my server but it keeps saying unexpected EOF... i cannot see the problem with it, and it worked before i edited the script to work on my ipod touch as well. Here is the troublsome code...
if ; then
tar -czf "file(Mac).tar.gz" "/folder" >... (11 Replies)
Just a quick question: How does gzip behave under linux if it's source is a file that is currently being written to by a different process? Basically, in my below code I want to make sure that there is ultimately no loss of data; ie. the gzip command runs until it "catches up" to the end of the... (16 Replies)
Dear All,
I am using FTP in a script. But when i exit from the FTP session, the commands written after EOF don't get executed.
i.e.
ftp <<EOF
quote $login
quote $password
cd /tmp
mget *somefile*
bye
EOF
echo $some_variable
#This last echo command or whatever piece of commands i... (10 Replies)
Ignoring other considerations for a moment and in general ...
Would there be a difference in result (dot oh or execution) of:
A.
strncpy( a, b, sizeof(a) );
vs.
B.
c = sizeof(a);
strncpy( a, b, c );
My general understanding is (at least I think my understanding is) that... (10 Replies)