fifo

What's the best relational structure for implementing a FIFO product inventory?

What's the best relational structure for implementing a FIFO product inventory? I need that the product entries be stored grouped by entry date and entry price, but sales from the existing stock be made in a First-In-First-Out manner, in which the product quantity representing the sale would be subtracted from the oldest entries first. T...

Is named FIFO secrue to prevent normal user from seeing sensitive data?

If I have some sensitive data to transfer between two processes, I can create a named FIFO in /tmp and delete it after use. I want to know if this method secure? How easy will it be to break the FIFO? I know there are several ways to perform IPC(inter-processes communication), but IMHO, pipe is not ideal since it sometimes left buffered...

Capturing program output.

i am making a small library that will basically capture the standard outputs of a program (such as printf()) into a separate process/thread...this process should then perform certain tasks (lets say write these captured outputs to a file)...i am just beginning to do serious C programming so i am still learning. i wanted to know what is ...

threadsafe single-consumer, single-producer FIFO on embedded system

I have a TI DSP (TMS320F28235 if anyone cares) that I need to implement a FIFO for queueing information between main-loop code and an interrupt. High-speed execution for this queue is very critical but so is proper operation, and I'm not sure whether I can get away with implementing a FIFO without any explicit synchronization, or if not,...

forcing a program to flush its standard output when redirected

i have a closed source program that prints output to standard output. i need to parse the output. so i redirect the output to a fifo (from which i can read in the parent process that forks and execs the binary) using dup2 and then exec the program. the problem is that the fprintf calls in the file become buffered because it is now writin...

Why is LRU better than FIFO?

Why is Least Recently Used better than FIFO in relation to page files? ...

How to make os.mkfifo and subprocess.Popen work together?

I'm trying to redirect a patch command output using a named pipe. I tried like this: fifo = os.path.join(self.path, 'pipe') os.mkfifo(fifo) op = os.popen('cat '+ fifo) proc = Popen(['patch', current_keyframe, '--input='+fpath, '--output='+fifo], stdin=PIPE, stdout=PIPE) os.unlink(fifo) print op.read() But my script stops at Popen() ca...

FIFO list (moving elements) [C++]

Good evening, people! I'm trying to solve a rather simple problem, but.. well, it seems that I can't. :) The idea is that I have a FIFO list (FIFO queue) with n elements and it's given a value, k (k < n). My little program has to move the elements to the left with k elements. (e.g. for n=4, k=3, a[]=(1, 2, 3, 4), the result is 4 1 2 3)...

Can Sql Server BULK INSERT read from a named pipe/fifo?

Is it possible for BULK INSERT/bcp to read from a named pipe, fifo-style? That is, rather than reading from a real text file, can BULK INSERT/bcp be made to read from a named pipe which is on the write end of another process? For example: create named pipe unzip file to named pipe read from named pipe with bcp or BULK INSERT or: ...

Writing .Ts file 'on demand' (inotify ?...)

Hello, I have a mediaplayer that can only read samba shared files. I would like to play http stream (from my dreambox for instance). My idea is to share a folder on my linux. In this share, I will put a (fake?) file for each tv channel I want to be able to watch (ex : channel1.ts, channel2.ts ...). The mediaplayer can only read these ...

Filter with FIFO

I'd like to filter incoming pakets from a stream within a certain amount of time. e.g. filter all "A" within 5 seconds 10:00:00 "A" <- show 10:00:01 "A" <- don't show 10:00:02 "B" <- show 10:00:03 "A" <- don't show 10:00:06 "A" <- show I thought about implementing this with a sort of FIFO. what do you think might be the best solu...

read the last line of a fifo

Here is the situation : Some process writes lines into a fifo file (created with mkfifo). At some point in my program, I want to read the last line in the fifo, and discard all the others. The procedure may block, only if there is less than one line in the fifo. I can't come up with a clean way to do this, any ideas ? EDIT : The writi...

Getting readline to block on a FIFO

I create a fifo: mkfifo tofetch I run this python code: fetchlistfile = file("tofetch", "r") while 1: nextfetch = fetchlistfile.readline() print nextfetch It stalls on readline, as I would hope. I run: echo "test" > tofetch And my program doesn't stall anymore. It reads the line, and then continues looping forever. Why w...

Named pipe blocking with user nobody

I have 2 short scripts. The first, an awk script, processes a large file and prints to a named pipe 'myfifo.dat'. The second, a Perl script, runs a LOAD DATA LOCAL INFILE 'myfifo.dat'... command. Both of these scripts work when run locally like so: lee.awk big.file & lee.pl However, when I call these scripts from a PHP webpage, the n...

Python (Twisted) - reading from fifo and sending read data to multiple protocols

Hi, Im trying to write some kind of multi protocol bot (jabber/irc) that would read messages from fifo file (one liners mostly) and then send them to irc channel and jabber contacts. So far, I managed to create two factories to connect to jabber and irc, and they seem to be working. However, I've problem with reading the fifo file - I...

*nix: "echo 'start working' > /etc/.example" : how is this implemented?

Say someone executes the following in a terminal: echo 'start working' > /etc/.example and when this is executed, the example program would "start working." On UNIX(-like) systems, how would something like that be implemented, and what is this kind of behavior called? ...

How to read/write from erlang to a named pipe ?

I need my erlang application to read and write through a named pipe. Opening the named pipe as a file will fail with eisdir. I wrote the following module, but it is fragile and feels wrong in many ways. Also it fails on reading after a while. Is there a way to make it more ... elegant ? -module(port_forwarder). -export([start/2, forwa...

Data in linux FIFO seems lost

Hi, I have a bash script which wants to do some work in parallel, I did this by putting each job in an subshell which is run in the background. While the number of jobs running simultaneously should under some limit, I achieve this by first put some lines in a FIFO, then just before forking the subshell, the parent script is required to...

Bidirectional FIFO

I would like to implement a bidirectional fifo. The code below is functioning but it is not using bidirectional fifo. I have searched all over the internet, but haven't found any good example... How can I do that? Thanks, WRITER.c: #include <stdio.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/wa...

can anybody suggest go-lang container for simple and fast FIFO stack

can anybody suggest go-lang container for simple and fast FIFO stack, go have 3 different container pkg heap, list and vector. which is more suitable to implement FIFO stack? thanks. ...