Hi gurus
I am not a C programmer but I need to read and write files on a computer on LAN using IP address.
Suppose on a computer that has an IP 192.168.0.2
Any help or code example. I did in JAVA using URL, but do not know how to do in ANSI-C.
In java:
-------
URL url = new... (3 Replies)
Hi All,
Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this.
I have list of files -
adc_earnedpoints.20070630.txt
adc_earnedpoints.20070707.txt
adc_earnedpoints.20070714.txt
adc_earnedpoints.20070721.txt... (1 Reply)
Hi my prob statement is to create a new file or to append to the 1tst file the followign chages.
File 1: txt file.
portfolio No a b c d
abc 1 Any Any Any charString
cds 2 values values values charString
efd 3 can can can charString
fdg 4 come come come charString... (4 Replies)
Hi all,
I have the following shell script code which tries to sftp and writes the log into the log file.
TestConnection ()
{
echo 'Connection to ' $DESTUSERNAME@$DESTHOSTNAME
$SETDEBUG
if ]; then rm $SCRIPT ; fi
touch $SCRIPT
echo "cd" $REMOTEDIR >> $SCRIPT
echo "quit" >>... (10 Replies)
Hello everybody,
I'm trying to code a program which makes the following:
It sends an ARP request frame and when it gets the reply, extracts the IP address of source and writes it to a .txt file. This is gonna be done with many hosts (with a for() loop), so, the text file would look like... (2 Replies)
Hi All,
Please help me in writing data to a file in one row.
In database there is a column which contains large data which does not fit in the file in one row. The column contains list of paths. I want to write these paths to a file in one row.
Please find the code below writes :
... (2 Replies)
Hi,
I am new to shell programming and need help. I have File1 with some ID numbers and File2 with ID number and some associated information.
I want to match the ID numbers from File1 to contents in File2 and output a third file which pulls out the ID numbers and the associated information with... (2 Replies)
Need to develop a unix shell script for the below requirement and I need your assistance:
1) search for file.log and file.bad file in a directory and read them
2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file
4) concatinate each row from bad file as... (3 Replies)
Hi All,
Here is my requirement. I am grepping through the log files and cutting some fields from the file to generate a csv file. Now I have to check if 2nd field is having some fixed value then with the help of 4th field I have to look in same log and run another grep command to retrieve the... (11 Replies)
Dear All,
I am reading one XML file to extract value from the particular tag:-
Sample xml is below:-
<KeyValuePairs>
<Key>TestString</Key>
<Value>Test12_Pollings</Value>
</KeyValuePairs>
I want to read the value for the KEY tag and there will be multiple key tags :-
awk... (4 Replies)
Discussion started by: sharsour
4 Replies
LEARN ABOUT CENTOS
close
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. If a command in a command pipe-
line created with open returns an error, close generates an error (similar to the exec command.)
EXAMPLE
This illustrates how you can use Tcl to ensure that files get closed even when errors happen by combining catch, close and return:
proc withOpenFile {filename channelVar script} {
upvar 1 $channelVar chan
set chan [open $filename]
catch {
uplevel 1 $script
} result options
close $chan
return -options $options $result
}
SEE ALSO
file(n), open(n), socket(n), eof(n), Tcl_StandardChannels(3)KEYWORDS
blocking, channel, close, nonblocking
Tcl 7.5 close(n)