named-pipes

FIFO - Restore communication in C ++

寵の児 提交于 2020-01-15 03:47:47
问题 I have a main program written in C ++. It triggers child programs using vfork () and execl (). Communication between them works perfectly using FIFO (the parent writes and the child reads). In the main program the sequence for establishing communication is if (mkfifo(CONTROLLER_file, 0666) < 0) perror("mkfifo"); if((aux_fd = open(CONTROLLER_file, O_RDONLY | O_NONBLOCK) )< 0) perror("Opening error"); if((fd = open(CONTROLLER_file, O_WRONLY)) < 0) perror("Opening error"); I do this to avoid the

SqlConnection error Named Pipes Provider

纵饮孤独 提交于 2020-01-14 05:18:07
问题 A little background: I have a Windows .NET application that is in use by approximately 40 field employees across North America. This program allows the users to enter data while in the field (away form internet access) and then synchronizes to our Sql Server 2005 database at night. A couple days ago, two of my users reported getting the following error when they performed an action that would attempt to connect to our server database (which uses .NET's SqlConnection class). System.Data

Windows named pipes in practice

六眼飞鱼酱① 提交于 2020-01-11 02:39:27
问题 With Windows named pipes, what is the proper way to use the CreateNamedPipe , ConnectNamedPipe , DisconnectNamedPipe , and CloseHandle calls? I am making a server app which is connecting to a client app which connects and disconnects to the pipe multiple times across a session. When my writes fail because the client disconnected, should I call DisconnectNamedPipe , CloseHandle , or nothing on my handle. Then, to accept a new connection, should I call CreateNamedPipe and then ConnectNamedPipe

IPC using pipes?

元气小坏坏 提交于 2020-01-07 07:59:08
问题 I m trying to implement a program using pipes where parent process accepts a string and passes it to child process. Need to be done with only single pipe. How does the pipe read & write accepts string. Here is my sample code! all! #include <iostream> #include <unistd.h> #include <stdio.h> #include <sys/types.h> using namespace std; int main() { int pid[2]; ssize_t fbytes; pid_t childpid; char str[20], rev[20]; char buf[20], red[20]; pipe(pid); if ((childpid = fork()) == -1) { perror("Fork");

using sqlldr from java

℡╲_俬逩灬. 提交于 2020-01-07 05:08:14
问题 I have a Java utility for database imports. I'd like to be able to use sqlldr for performance on oracle. I could create the control and data files, but that doesn't seem like The Right Thing™ to do. I should be able to stream the data by providing INFILE "-" in the control file ( q1 - how? from command line, I can pipe " echo <data...> " to the sqlldr, but there must be a way to just stream the string into the input stream for the process? never used Java for this before). I can't see how to

Linux named fifo non-blocking read select returns bogus read_fds

限于喜欢 提交于 2020-01-06 09:09:07
问题 Similar to the problem asked a while ago on kernel 3.x, but I'm seeing it on 4.9.37. The named fifo is created with mkfifo -m 0666 . On the read side it is opened with int fd = open(FIFO_NAME, O_RDONLY | O_NONBLOCK); The resulting fd is passed into a call to select() . Everything works ok, till I run echo >> <fifo-name> . Now the fd appears in the read_fds after the select() returns. A read() on the fd will return one byte of data. So far so good. The next time when select() is called and it

redirect ftp pipe in C

百般思念 提交于 2020-01-05 09:26:57
问题 I am using NamedPipe in windows Application Programming to redirect cmd.exe Input/Output buffer to my program console. everything works good until I enter commands like "ftp". if you type this to real cmd.exe console you recive "ftp>" in terminal, but I don't.it is my code: #include <windows.h> #include <tchar.h> #include <stdio.h> #include <strsafe.h> #define BUFSIZE 4096 HANDLE hReadChildInput = NULL; HANDLE hWriteChildInput = NULL; HANDLE hReadChildOutput = NULL; HANDLE hWriteChildOutput =

redirect ftp pipe in C

試著忘記壹切 提交于 2020-01-05 09:24:20
问题 I am using NamedPipe in windows Application Programming to redirect cmd.exe Input/Output buffer to my program console. everything works good until I enter commands like "ftp". if you type this to real cmd.exe console you recive "ftp>" in terminal, but I don't.it is my code: #include <windows.h> #include <tchar.h> #include <stdio.h> #include <strsafe.h> #define BUFSIZE 4096 HANDLE hReadChildInput = NULL; HANDLE hWriteChildInput = NULL; HANDLE hReadChildOutput = NULL; HANDLE hWriteChildOutput =

How to make a compressed file directly usable as a regular file?

我的梦境 提交于 2020-01-05 06:44:29
问题 We have a custom compressor for genomic data called CRAM, and althogugh it provides superior compression people are afraid to use it, because it is not-so-easy to handle with bioinformatic tools as "regular" files. We would like to allow compressed file to be used for example as parameters to scripts, be opened in GUIs, etc. just like classic files. Like a named pipe or block device file that automatically executes the unzip command whenever it is read from. If it is easy to copy from system

Why my named pipe input command line just hangs when it is called?

送分小仙女□ 提交于 2020-01-05 05:29:07
问题 Why my named pipe input command line just hangs when it is called? Based on the answers: Writing to stdin of background process Accessing bash command line args $@ vs $* Send command to a background process Can I redirect output to a log file and background a process at the same time? I wrote two shell scripts to communicate with my game server. And worked the first time I did it. Since it them they do not work anymore. Every time I do ./send.sh commands the command line hangs until I hit