fgets:
Reads a line from the specified stream and stores it into the string pointed to by str. It stops when either (n-1) characters are read, the newline character is read, or the end-of-file is reached, whichever comes first. The newline character is copied to the string. gets:
Reads a line from stdin and stores it into the string pointed to by str. It stops when either the newline character is read or when the end-of-file is reached, whichever comes first. The newline character is not copied to the string.
Last edited by ironmask2004; 12-13-2009 at 07:46 AM..
the count is off ... man ... help please.
The Code
open (FILE1, "xy1.TXT") or die "$0: Could not open SOURCEFILE.TXT: $!\n";
open (FILE2, "xy2.TXT") or die "$0: Could not open RESULTFILE.TXT: $!\n";
chomp(my @strings = <FILE2>);
while (1) {
foreach $pattern (<FILE1>) {
... (3 Replies)
I have input file like this
Input file:
ABC|abc_etc_passwd
XYZ|XYZ_etc_passwd
zXY|XYZ_etc_passwd
IJK|test_etc_passwd
KLM|test_etc_passwd
i want to do following in a loop.
grep 'ABC' *abc_etc_passwd*
grep 'XYZ' *XYZ_etc_passwd*
grep 'ZXY' *ZXY_etc_passwd*
i have tried this
for i... (2 Replies)
I am new to solaris and I replaced a faulty tape drive sun DLT7000
But, I am getting the follwoing error when system reboots
ltid deamon error drive index 1 is not correct, drive name /dev/rmt/2cbn is incorrect no such file or directory.
I have two drives the other one is /dev/rmt/0cbn,... (8 Replies)
I was trying to copy all debs from apt cache to some storage location and I was taking this approach...
/var/cache/apt/archives# ls -1 | grep -v jdownloader | fgrep .deb | xargs cp /media/eshant/L-STORE/Softwares/openjdk/an error bla_bla.deb is a not directory stalled me
Suggestions please... (9 Replies)
Hi,
I tried writing a script and there was a problem with SFTP part
can some one correct where is is the mistake
Enveronment file
#!/bin/bash
export HOST_NAME=<>
export USER_NAME=<>
export PASSWORD=<>
export SOURCE_PATH=/u03/informatica/current/server/infa_shared/TgtFiles/mfg
export... (4 Replies)
Hi Team,
I have below data , could you please help to get correct mail id in oracle only.
bhatt,rabi rabi.bhatt@n.com, test, mishra test.mishra@n.com, skype, amit skype.amit@n.com,
output like :rabi.bhatt@n.com
test.mishra@n.com
skype.amit@n.com
Please use CODE tags as required... (6 Replies)
Discussion started by: Jewel
6 Replies
LEARN ABOUT PHP
fpurge
FPURGE(3) Linux Programmer's Manual FPURGE(3)NAME
fpurge, __fpurge - purge a stream
SYNOPSIS
/* unsupported */
#include <stdio.h>
int fpurge(FILE *stream);
/* supported */
#include <stdio.h>
#include <stdio_ext.h>
void __fpurge(FILE *stream);
DESCRIPTION
The function fpurge() clears the buffers of the given stream. For output streams this discards any unwritten output. For input streams
this discards any input read from the underlying object but not yet obtained via getc(3); this includes any text pushed back via ungetc(3).
See also fflush(3).
The function __fpurge() does precisely the same, but without returning a value.
RETURN VALUE
Upon successful completion fpurge() returns 0. On error, it returns -1 and sets errno appropriately.
ERRORS
EBADF stream is not an open stream.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+-----------+---------------+---------------------+
|Interface | Attribute | Value |
+-----------+---------------+---------------------+
|__fpurge() | Thread safety | MT-Safe race:stream |
+-----------+---------------+---------------------+
CONFORMING TO
These functions are nonstandard and not portable. The function fpurge() was introduced in 4.4BSD and is not available under Linux. The
function __fpurge() was introduced in Solaris, and is present in glibc 2.1.95 and later.
NOTES
Usually it is a mistake to want to discard input buffers.
SEE ALSO fflush(3), setbuf(3), stdio_ext(3)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
2017-09-15 FPURGE(3)