|
by: Bernhard Kuemel |
last post by:
Hi!
I want to read/write commands and program input to/from /bin/bash
several times before I close the stdin pipe. However, reading
from cat hangs unless I first close the stdin pipe.
<?php
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child
|
by: Phil Powell |
last post by:
In TCL it would be written this way:
I guess what I need is the PHP equivalent of TCL's gets command (see
http://www.astro.princeton.edu/~rhl/Tcl-Tk_docs/tcl8.0a1/gets.n.html
for more information)
or perhaps the PHP equivalent of how a Java app would read from
standard in:
|
by: viza |
last post by:
Hi!
Is there any harm/advantage to closing the standard input stream if I am not
going to read from it again?
I have:
if(blah)
fileptr=fopen(blah);
else
|
by: Steve |
last post by:
Is it allowed to fclose stdin?
Trying it here it seems to work ok, but it occurs to me that on some other
system the standard library might call fclose(stdin) during its clean up,
and calling fclose twice (on normal streams at least) gives undefined
behaviour.
|
by: Charlie Zender |
last post by:
Hi,
I have a program which takes the output filename argument from stdin.
Once the program knows the output filename, it tries to open it.
If the output file exists, the program asks the user to confirm
whether he really wants to overwrite the existing output file.
The problem is that the second read from stdin, to obtain the user
response whether to overwrite the existing output file, never
waits for the user's response. It's as if a...
|
|
by: David Mathog |
last post by:
A program of mine writes to a tape unit. Output can be either through
stdout or through a file opened with fopen(). When all the data is
transferred to tape the program needs to close the output stream so that
the tape driver will write a filemark on the tape. Otherwise multiple
clumps of data saved to tape would all appear to be one big file on the
tape.
When the tape unit device was explicitly opened with fopen()
that's possible:...
|
by: Nikos Chantziaras |
last post by:
Hello.
Is there a way to check if the current process has an stdin handle? In
the win32 API, one can do:
_eof(_fileno(stdin))
Crucial here is that the above doesn't block. Is there a standard way
to do the same without resorting to OS-specific API calls?
|
by: kimonp |
last post by:
I am running on windows XP with a fresh install of wamp5 (1.7.2) and mediawiki.
I am trying to call a perl function from within php using proc_open.
The perl script is being executed and returns a successful exit value, and I can read the results it prints to STDOUT in PHP, but the perl script does not see STDIN from PHP. Since I want to use the perl script as a filter and I don't want to create an intermediary file, this is problematic....
|
by: Bartc |
last post by:
This short program:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int status;
status=fclose(0);
|
by: wrenashe |
last post by:
I am on windows 2003, basically my codes want to do such a thing:
1. fopen a file A.
2. dup2(A, stdout);
3. dup2(A, stderr);
4. fclose(A);
5. rename(A), and move it to somewhere else.
6, fopen(A);
7. dup2(A, stdout);
8. dup2(A, stderr);
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|