Search Results

Search found 3993 results on 160 pages for 'broken pipe'.

Page 2/160 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Program quits if pipe is closed

    - by givemelight
    I am trying to write to a pipe using C++. The following code gets called in an extra thread: void writeToPipe() { int outfifo; char buf[100]; char outfile[] = "out"; mknod(outfile, S_IFIFO | 0666, 0); if ((outfifo = open(outfile, O_WRONLY)) < 0) { perror("Opening output fifo failed"); return false; } int currentTimestamp = (int)time(0); int bufLen = sprintf(bug, "Time is %d.", currentTimestamp); write(outfifo, buf, bufLen); } The thread is called in main using: thread writeThread(writeToPipe); writeThread.detach(); If the pipe is not opened by another process, the C++ program just quits without an error. I don't know how to check if the pipe is opened.

    Read the article

  • Can't pipe echo to netcat?

    - by user1641300
    I have the following command: echo 'HTTP/1.1 200 OK\r\n' | nc -l -p 8000 -c and when I curl localhost:8000 I am not seeing HTTP/1.1 200 .. being printed. I am on mac os x with netcat 0.7.1 Any ideas? #!/bin/bash trap 'my_exit; exit' SIGINT SIGQUIT my_exit() { echo "you hit Ctrl-C/Ctrl-\, now exiting.." # cleanup commands here if any } if test $# -eq 0 ; then echo "Usage: $0 PORT" echo "" exit 1 fi while true do echo "HTTP/1.1 200 OK\r\n" | nc -l -p ${1} -c done and testing with: curl localhost:8000

    Read the article

  • pipe from tar to ftp

    - by facha
    I have ftp access to a server I do not control. I'd like to start sending archives of my server's FS to that ftp. The problem is I don't have enough free space on my system to create a backup archive first (and store it on my fs) and then send it to ftp. So I'm wondering if it is possible to do something like this: tar -jcpvf - / | ftp-put ftp://user:pass@host/file.tbz Normally there is no problem doing it over ssh, but in this case I only have ftp available.

    Read the article

  • Unix bidirectional pipe on commandline

    - by John W
    I've been able to use this linux command to connect Netcat to a serial port: nc -l 80 <> /dev/ttyS0 I would like to be able to log this transaction. My backup plan is to use Wireshark to monitor the netcat stream, but ideally I'd like to do something like this: cat /dev/ttyS0 | tee upstream.bin | nc -l 80| tee downstream.bin | /dev/ttyS0 This tries to open ttyS0 twice and therefore throws a permissions error. Does anyone know a smarter way to do this?

    Read the article

  • How do I pipe terminal standard output (stdout) to the clipboard?

    - by Insperatus
    For example, Say I want to list the contents of a folder and directly paste them into a chat window for a friend to see. I realize I could do ls > filename.txt to create a file (filename.txt) with those contents; I'd then have to open or print the file and manually select and copy the text block (which can be annoying/tedious.) I clearly could also select and copy the output of ls directly from within the terminal window. It would be much faster/easier to simply pipe standard output to the clipboard. What terminal command allows me to do this?

    Read the article

  • Is my Nokia 5310 lcb broken?

    - by aF
    Hello, I have a nokia 5310 xpress music and my monitor won't turn on. When I turn on the cell phone, I see some lights from the keyboard but the lcd doesn't turn on. Is the lcd screen of my nokia broken or can it be another thing?

    Read the article

  • Behavior of a pipe after a fork()

    - by Steve Melvin
    When reading about pipes in Advanced Programming in the UNIX Environment, I noticed that after a fork that the parent can close() the read end of a pipe and it doesn't close the read end for the child. When a process forks, does its file descriptors get retained? What I mean by this is that before the fork the pipe read file descriptor had a retain count of 1, and after the fork 2. When the parent closed its read side the fd went to 1 and is kept open for the child. Is this essentially what is happening? Does this behavior also occur for regular file descriptors?

    Read the article

  • Pipe ffmpeg to oggenc(2) with .NET

    - by acidzombie24
    I am trying to encode ogg files at -q 6/192k. ffmpeg doesnt seem to be listenting to my command ffmpeg -i blah -acodec vorbis -ab 192k -y out.ogg So i would like to use the recommended ogg encoder. It says the input must be wav or similar. I would like to pipe a wav from ffmpeg to ogg. However not only am i unsure if oggenc2 will accept input from stdin, i have no idea how to pipe one process to another inside of .net using the Process class.

    Read the article

  • Django + WebKit = Broken pipe

    - by Saosin
    I'm running the Django 1.2 development server and I get these Broken Pipe error messages whenever I load a page from it with Chrome or Safari. My co-worker is getting the error as well when he loads a page from his dev server. We don't have these errors when using Opera or Firefox. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 281, in run self.finish_response() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 321, in finish_response self.write(data) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 417, in write self._write(data) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 300, in write self.flush() File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 286, in flush self._sock.sendall(buffer) error: [Errno 32] Broken pipe Can anyone help me out? I'm going crazy over this!

    Read the article

  • How to rate-limit a pipe under linux ?

    - by Frédéric Grosshans
    Is there a filter which I could use to rate-limit a pipe on linux? If this exists, let call it rate-limit, I want to be able to type in a terminal something like cat /dev/urandom | rate-limit 3 -k | foo in order to send a a stream of random bytes to foo's standard input at a rate (lower than) 3 kbytes/s.

    Read the article

  • Ctrl key is broken on HP Envy is broken, where can I find a replacement

    - by NewProger
    I work as a developer so I have to use key combinations a lot. And I have HP Envy laptop. And the Ctrl key is broken for the second time. First time I just took one from my friend. But I don't have any more friends who are willing to sacrifice their Ctrl key Anyone know where I can find one? (or rather a bunch because they are so weak and low quality) I tried to contact HP support but they did everything to prevent people from doing it. And it is impossible to reach HP support. And in my case where warranty is expired it is not possible at all according to their rules. Also I tried Googling but found nothing

    Read the article

  • C Named pipe (fifo). Parent process gets stuck

    - by Blitzkr1eg
    I want to make a simple program, that fork, and the child writes into the named pipe and the parent reads and displays from the named pipe. The problem is that it enters the parent, does the first printf and then it gets weird, it doesn't do anything else, does not get to the second printf, it just ways for input in the console. #include <string.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> void main() { char t[100]; mkfifo("myfifo",777); pid_t pid; pid = fork(); if (pid==0) { //execl("fifo2","fifo2",(char*)0); char r[100]; printf("scrie2->"); scanf("%s",r); int fp; fp = open("myfifo",O_WRONLY); write(fp,r,99); close(fp); printf("exit kid \n"); exit(0); } else { wait(0); printf("entered parent \n"); // <- this it prints // whats below this line apparently its not being executed int fz; printf("1"); fz = open("myfifo",O_RDONLY); printf("2"); printf("fd: %d",fz); char p[100]; int size; printf("------"); //struct stat *info; //stat("myfifo",info); printf("%d",(*info).st_size); read(fz,p,99); close(fz); printf("%s",p); printf("exit"); exit(0); } }

    Read the article

  • Using SAS Macro to pipe a list of filenames from a Windows directory

    - by Bazil
    I am trying to amend the macro below to accept a macro parameter as the 'location' argument for a dir command. However I cannot get it to resolve correctly due to the nested quotes issue. Using %str(%') does not work, neither do quoting functions for some reason. The macro will work fine when the filepath has no spaces (eg C:\temp\withnospace) as the middle quotes aren't needed. However I need this macro to work for filepaths with spaces (eg 'C:\temp\with space\'). Please help! %macro get_filenames(location) filename pipedir pipe "dir &location. /b " lrecl=32767; data filenames; infile pipedir truncover; input line $char1000.; run; %mend; %get_filenames(C:\temp\) /* works */ %get_filenames('C:\temp\with space') /* doesnt work */

    Read the article

  • Pipe between two console applications?

    - by ronag
    How can I pipe between two separate console application running in different console windows? e.g. I would like to do something similar to: ffmpeg -i 0.flv -vcodec mpeg4 -f asf -s cif - | vlc - However, I would like to do this from two separate windows, which doesn't work, I guess this is because standard out is local to cmd windows. cmd window 1: ffmpeg -i 0.flv -vcodec mpeg4 -f asf -s cif - cmd window 2: vlc - Is there any way to programmatically achieve this? What exactly does | do behind the scenes?

    Read the article

  • DIY Standing Desk Sports Super Sturdy Galvanized Pipe Legs

    - by Jason Fitzpatrick
    If you’re looking for a standing desk sturdy enough you can tap dance on it this DIY creation features thick pipe legs and a solid oak desktop. Courtesy of designer Jessica Allen, this standing desk can easily support a bank of monitors, heavy equipment, and even your entire body if need be, thanks to a sturdy galvanized plumbing pipe undercarriage and a 1″ thick oak top. We love the clean lines of the desk but we’d be tempted to clutter them up a little with a tower-rack mounted under the desk or on the inside of the thick pipe legs. Hit up the link below to check out the full build log. Have a cool standing desk (or desk tutorial) to share? Sound off in the comments. Steel Pipe Standing Desk HTG Explains: Why Screen Savers Are No Longer Necessary 6 Ways Windows 8 Is More Secure Than Windows 7 HTG Explains: Why It’s Good That Your Computer’s RAM Is Full

    Read the article

  • How can i fix some broken packages PyQt packages?

    - by Jorge
    I'm trying to install PyQt but i've met some difficulties (i.e packages that won't be updated and stuff like that). I'm not very proficient with Ubuntu, so some help is needed. Here's the output i get from the terminal: sudo apt-get install python-qt4 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: python-qt4 : Depends: libqt4-declarative (>= 4:4.7.0~rc1) but it is not going to be installed Depends: libqt4-designer (>= 4:4.7.0) but it is not going to be installed Depends: libqt4-help (>= 4:4.7.0) but it is not going to be installed Depends: libqt4-script (>= 4:4.7.0) but it is not going to be installed Depends: libqt4-scripttools (>= 4:4.7.0) but it is not going to be installed Depends: libqt4-svg (>= 4:4.7.0) but it is not going to be installed Depends: libqt4-test (>= 4:4.7.0) but it is not going to be installed Depends: libqt4-xmlpatterns (>= 4:4.7.0) but it is not going to be installed E: Broken packages

    Read the article

  • Bash script, read values from stdin pipe

    - by gmatt
    I'm trying to get bash to process data from stdin that gets piped it, but no luck, what I mean is none of the following work: echo "hello world" | test=($(< /dev/stdin)); echo test=$test test= echo "hello world" | read test; echo test=$test test= echo "hello world" | test=`cat`; echo test=$test test= where I want the output to be test=hello world. Note I've tried putting "" quotes around "$test" that doesn't work either.

    Read the article

  • SSRS Broken Embedded Image

    - by CodeGrue
    I have a SQL Server Reporting Services report with an embedded image in the header. It works fine in preview mode and if I inspect the RDL file, it has the encoded image stream in there. However, when I deploy the report to the server and view the report in the Report Manager, the image shows with a broken X icon. Has anyone experienced this?

    Read the article

  • IOError: [Errno 32] Broken pipe

    - by khati
    I got "IOError: [Errno 32] Broken pipe" while writing files in linux. I am using python to read each line a of csv file and then write into a database table. My code is f = open(path,'r') command = command to connect to database p = Popen(command, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) query = " COPY myTable( id, name, address) FROM STDIN WITH DELIMITER ';' CSV QUOTE '"'; " p.stdin.write(query.encode('ascii')) *-->(Here exactly I got the error, p.stdin.write(query.encode('ascii')) IOError: [Errno 32] Broken pipe )* So when I run this program in linux, I got error "IOError: [Errno 32] Broken pipe" . However this works fine when I run in windows7. Do I need to do some configuration in Linux sever? Any suggestions will be appreciated. Thank you.

    Read the article

  • Linux: Limiting data throughput (pipe) in bytes per second?

    - by sdaau
    Hi all, I was wandering if there is a Linux program that can limit data throughput of a pipe - in actual bytes per second?. From what I gather, applicable for the purposes would be bfr, however, it has been removed from Debian (Removal candidate: bfr) cpipe, however, it seems the lowest resolution it will support is kB/s, meaning that buffer writes can still reach MB/s ([SOLVED] Is there a program to limit terminal pipe speed? - Page 2 - Ubuntu Forums) What I'd want is to be able to specify something like cat example.txt | ratelimit -Bps 100 > /dev/ttyUSB0 ... and actually have a single byte from example.txt sent each 1/100 = 0.01 sec (or 10 ms) to 'output'.. Thanks in advance for any suggestions, Cheers!

    Read the article

  • c# Named Pipe Asynchronous Peeking

    - by KJ Tsanaktsidis
    Hey all, I need to find a way to be notified when a System.IO.Pipe.NamedPipeServerStream opened in asynchronous mode has more data available for reading on it- a WaitHandle would be ideal. I cannot simply use BeginRead() to obtain such a handle because it's possible that i might be signaled by another thread which wants to write to the pipe- so I have to release the lock on the pipe and wait for the write to be complete, and NamedPipeServerStream doesnt have a CancelAsync method. I also tried calling BeginRead(), then calling the win32 function CancelIO on the pipe if the thread gets signaled, but I don't think this is an ideal solution because if CancelIO is called just as data is arriving and being processed, it will be dropped- I still wish to keep this data, but process it at a later time, after the write. I suspect the win32 function PeekNamedPipe might be useful but i'd like to avoid having to continuously poll for new data with it. In the likley event that the above text is a bit unclear, here's roughly what i'd like to be able to do... NamedPipeServerStream pipe; ManualResetEvent WriteFlag; //initialise pipe lock (pipe) { //I wish this method existed WaitHandle NewDataHandle = pipe.GetDataAvailableWaithandle(); Waithandle[] BreakConditions = new Waithandle[2]; BreakConditions[0] = NewDataHandle; BreakConditions[1] = WriteFlag; int breakcode = WaitHandle.WaitAny(BreakConditions); switch (breakcode) { case 0: //do a read on the pipe break; case 1: //break so that we release the lock on the pipe break; } }

    Read the article

  • How to create named pipe acsessible Only on your machin? (VS08 C++)

    - by Ole Jak
    Hello, I have created a program that write video stream to a named pipe on windows, using Visual Studio C++ 2008 . how to be sequre that no one exept programms on this computer can acsess this pipe? npipe = CreateNamedPipe("\\\\.\\pipe\\TestChannel", PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES , 1024, 1024,5000,NULL);

    Read the article

  • Multithreading: Read from / write to a pipe

    - by Tero Jokinen
    I write some data to a pipe - possibly lots of data and at random intervals. How to read the data from the pipe? Is this ok: in the main thread (current process) create two more threads (2, 3) the second thread writes sometimes to the pipe (and flush-es the pipe?) the 3rd thread has infinite loop which reads the pipe (and then sleeps for some time) Is this so far correct? Now, there are a few thing I don't understand: do I have to lock (mutex?) the pipe on write? IIRC, when writing to pipe and its buffer gets full, the write end will block until I read the already written data, right? How to check for read data in the pipe, not too often, not too rarely? So that the second thread wont block? Is there something like select for pipes? It is possible to set the pipe to unbuffered more or I have to flush it regularly - which one is better? Should I create one more thread, just for flushing the pipe after write? Because flush blocks as well, when the buffer is full, right? I just don't want the 1st and 2nd thread to block.... [Edit] Sorry, I thought the question is platform agnostic but just in case: I'm looking at this from Win32 perspective, possibly MinGW C...

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >