You'd really need to base it upon some evaluation that you can control. You'd test the inputs, and based on behavior, you'd fork off in whatever direction you need. The following function provides a similar test for logging purposes (with some additional chatter for documentation purposes):
Is there any possibility that a Stream Read and Write queues will interchange messages of any kind. If so what are the different possiblites and under what circumstances ?
Thanks in advance. (4 Replies)
how can i read a part of filename from the list in the script?
all file in directory...will start with "CDBACKUPFILE" then the name is stored in list.txt such as JOHN,MARRY,PETER. After this, is seq number.
CDBACKUPFILEJOHN00001
CDBACKUPFILEMARRY00004
CDBACKUPFILEPETER00003
I will use:... (3 Replies)
I have 3 columns in an excel sheet.
c1 c2 c3
EIP_ACCOUNT SMALL_TS_01 select A.* from acc;
All the above 3 col shoud be passed a variable in the unix code.
1.How to read an excel file
2.How to pass these data as variable to the unic script (1 Reply)
I'm running Debian ib Bash shell. currently I'm streaming the data from ttyS1 . The data stream is 13 fields comma delimited
cat /dev/ttyS1
02/04/2009,10:57:18,1401.0,7.5,424.9,0.0,0.0,159.8,1401.0,7.5,265.2,34.4,2.5
The data is grouped for specific systems.
02/04/2009,10:57:18 ... (1 Reply)
Hi:
I have a collection of mp3s and I need to create 1 xml file per mp3.
I have:
recording1.mp3
recording2.mp3
etc
and I want to generate this kind of files.
recording1.xml
recording2.xml
and inside each xml file I need to add a url prefix and then the filename at the end.
... (4 Replies)
Hi @all,
i really stuck in programming a tool with bidirectional process communication (popen(cmd, "rw") ... something like that ;-)).
Here is the code:
if(pipe(p_stdin) != 0 || pipe(p_stdout) != 0) {
fprintf(stderr, "Aufruf von pipe() schlug fehl.\n");
exit(1);
}
... (6 Replies)
Hi
I used this command:
mplayer http://host/axis-cgi/mjpg/video.cgi -user root -passwd root \
-cache 1024 -fps 25.0 -nosound -vc ffh264 \
-demuxer 3 -dumpstream -dumpfile output.avi It's ok but...
Video Playing is very fast! Why? Is it a synch problem?
What parameter I have to use for... (1 Reply)
Hi,
I have a text file containing numbers. There are up to 6 numbers per row and I need to read them, check if they are 0 and if they are not zero check if they are within a given interval (min,max). If they exceed the max or min they should be set to max or min respectively, if they are in the... (4 Replies)
Hello;
I have this rather tricky problem to solve --(to me, anyways) ..
I am processing the following one liner with tcpdump..
tcpdump -i T3501 -A ether host 00:1e:49:29:fc:c9 or ether host 00:1b:2b:86:ec:1b or ether host 00:21:1c:98:a4:08 and net 149.83.6.0/24 | grep --line-buffered -B... (5 Replies)
We have the data looks like below in a log file.
I want to generat files based on the string between two hash(#) symbol like below
Source:
#ext1#test1.tale2 drop
#ext1#test11.tale21 drop
#ext1#test123.tale21 drop
#ext2#test1.tale21 drop
#ext2#test12.tale21 drop
#ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 Replies
LEARN ABOUT BSD
fopen
FOPEN(3S)FOPEN(3S)NAME
fopen, freopen, fdopen - open a stream
SYNOPSIS
#include <stdio.h>
FILE *fopen(filename, type)
char *filename, *type;
FILE *freopen(filename, type, stream)
char *filename, *type;
FILE *stream;
FILE *fdopen(fildes, type)
char *type;
DESCRIPTION
Fopen opens the file named by filename and associates a stream with it. Fopen returns a pointer to be used to identify the stream in sub-
sequent operations.
Type is a character string having one of the following values:
"r" open for reading
"w" create for writing
"a" append: open for writing at end of file, or create for writing
In addition, each type may be followed by a "+" to have the file opened for reading and writing. "r+" positions the stream at the begin-
ning of the file, "w+" creates or truncates it, and "a+" positions it at the end. Both reads and writes may be used on read/write streams,
with the limitation that an fseek, rewind, or reading an end-of-file must be used between a read and a write or vice-versa.
Freopen substitutes the named file in place of the open stream. It returns the original value of stream. The original stream is closed.
Freopen is typically used to attach the preopened constant names, stdin, stdout, stderr, to specified files.
Fdopen associates a stream with a file descriptor obtained from open, dup, creat, or pipe(2). The type of the stream must agree with the
mode of the open file.
SEE ALSO open(2), fclose(3)DIAGNOSTICS
Fopen and freopen return the pointer NULL if filename cannot be accessed, if too many files are already open, or if other resources needed
cannot be allocated.
BUGS
Fdopen is not portable to systems other than UNIX.
The read/write types do not exist on all systems. Those systems without read/write modes will probably treat the type as if the "+" was
not present. These are unreliable in any event.
In order to support the same number of open files as does the system, fopen must allocate additional memory for data structures using cal-
loc after 20 files have been opened. This confuses some programs which use their own memory allocators. An undocumented routine, f_preal-
loc, may be called to force immediate allocation of all internal memory except for buffers.
4th Berkeley Distribution May 27, 1986 FOPEN(3S)