Could someone Help me with this code please?
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <fcntl.h>
#define SIZE_B 256 /*buffer's size */
#define NUM_ARG 20 /* max number of args for any command */
int... (4 Replies)
Hi...Can anyone please guide me on FIFO Pipes in UNIX.I have lerant things like creating fifo pipes,using them for reads and writes etc.I want to know what is the maximum amount of memory that such a pipe may have? Also can anyone guide me on where to get info on this topic from? (1 Reply)
Gurus,
I've a File Transaction Server, which communicates with other servers and performs some processing.It uses many Named PIPE's.
By mistake i copied a named PIPE into a text file.
I heard that PIPE files shouldn't be copied.Isn't it?
Since it's a production box, i'm afraid on... (2 Replies)
Hi!!
I have a problem reading from a fifo pipe in shell script.
The idea is simple, I have a C program with two pipe files:
An input pipe I use to send commands in shell script to the C program (echo "command" > input.pipe)
An output pipe that I read the result of the command also in... (4 Replies)
Hi
This is a exercise question from Unix network programming vol2.
Why the SIGPIPE signal is generated only for writers when readers disappear.
why not it is generated for readers when writer disappears.
I guess, if the writer didn't get any response like the reader gets EOF,
it will... (4 Replies)
Hi guys.
1. how much is the size of pipe?(i mean the buffer size)
2. is this size different in various UNIX derivations?
3. what happens if we write to a full pipe? does it block until get some free space(the other side receive data) or returns an error?
3. FIFO s are physical files on the... (2 Replies)
I'm trying to read a fifo using awk and comming across some problems. I'm writing to the fifo from multiple processes invoked by GNU Parallel:
mkfifo my_fifo
awk '{ a = a + $2 } END { for (i in a) print i, a }' my_fifo | sort -nk1 > sorted_output
grep -v '^@' massive_file | parallel... (3 Replies)
Hi All,
I'm creating a program which reads millions of bytes from the PIPE and do some processing. As the data is more, the idea is to read the pipe parallely.
Sun Solaris 8
See the code below:
#!/bin/sh
MAXTHREAD=30
awk '{print $1}' metadata.csv > nvpipe &
while
do
... (3 Replies)
Discussion started by: mr_manii
3 Replies
LEARN ABOUT NETBSD
flock
FLOCK(1) BSD General Commands Manual FLOCK(1)NAME
flock -- Provide locking API for shell scripts
SYNOPSIS
flock [-dnosvx] [-w timeout] lockfile|lockdir [-c command] | [command ...]
flock [-dnsuvx] [-w timeout] lockfd
DESCRIPTION
The flock utility provides flock(2) access to the command line or scripts. The first form locks a file or directory while the command pro-
vided is executed. If the file or directory does not exist, then a file is created.
The second form can use an arbitrary file descriptor that is provided from a shell script for example:
(
flock -s 100
# commands to be executed under the lock
) 100> /path/to/lockfile
The following options are available:
-c command Pass a command to a the shell.
-d, --debug Provide debugging output.
-n, --nb, --nonblock
Don't block and fail immediately if the lock could not be obtained.
-o, --close Close the file before executing the command. This is useful if the child forks and should not be holding the lock.
-s, --shared Obtain a shared lock.
-u, --unlock Unlock an existing lock. This is available only for a file descriptor.
-v, --verbose On error print an explanation of the failure.
-w, --wait, --timeout seconds
Fail if the lock could not be obtained after seconds.
-x, --exclusive Obtain an exclusive lock.
EXIT STATUS
The flock utility exits 0 on success, and >0 if an error occurs.
SEE ALSO shlock(1), flock(2)HISTORY
An flock utility appeared in NetBSD 6.1.
BSD November 2, 2012 BSD