yes, so the content of file.txt will be written to stdin of a.out
Hi,
I know May be I was not clear enough of what I am trying to do,
The program is as follows -
I am doing following on shell command line -
$>file.txt (this create an empty file.txt)
$./a.out < file.txt (redirect standard input of a.out to file.txt, a.out is supposed to WRITE to(not READ from) file.txt(that is what it is programmed to do).
($ is not part of command but of shell command prompt)
STDIN_FILENO's file status flag is 2 (O_RDWR - both read write allowed).
I expected that a.out writes to standard input; which is file.txt. But file.txt remains empty.
I know May be I was not clear enough of what I am trying to do,
The program is as follows -
I am doing following on shell command line -
$>file.txt (this create an empty file.txt)
$./a.out < file.txt (redirect standard input of a.out to file.txt, a.out is supposed to WRITE to(not READ from) file.txt(that is what it is programmed to do).
($ is not part of command but of shell command prompt)
STDIN_FILENO's file status flag is 2 (O_RDWR - both read write allowed).
I expected that a.out writes to standard input; which is file.txt. But file.txt remains empty.
I am trying to understand 'why'
Anybody. Please illuminate
i dunno...why that happens. probably because file connects to stdin of a.out first, so when write command executes, stdin is connected to file so it is not able to write into stdin, hence it returns -1.
Well I wrote this in 2005 and uploaded to AMINET.as a commemoration of a machine that is still in use today.
It is now 29 years since this machne came into being. Phenominal and it is still being supported- WOW!
My A1200 is on 24/7 and I use it to test code developed on AMIGA emulators...
... (0 Replies)
Hi everyone. Silly might be silly be I'm still new to bash. I'm trying to make an Alarm Clock for in the morning using my laptop i have wrote this Simple Script but i cant work out how to play it at a certain time.
#!/bin/bash
cd /home/josh/Music/Bruno_Mars/Hooligans/
cvlc... (8 Replies)
Hello,
Who actually wrote Professional Linux Programming of Wrox publication as there are two different sets of writers, one set consists of Jon Masters and Richard Blum and another set of writers is Neil Mathew with lots of other writers. Plz resolve it. I'm really confused.
Regards.. (0 Replies)
I'm talking about boot process in multi-boot Linux perceptive.
Please tell me whether my explanation is right or wrong? If wrong, please explain.
"The BIOS checks the system and loads this initial bootstrapping code into
memory. This initial bootstrap code searches for an active partition... (0 Replies)
I have an unix id (AIX system) which is used to run a couple of processes. They also write some log files into a file system (that is not in the home directory of the user id, but in different location).
One bad day, the id was deleted accidentally. But the home directory, files and everything... (1 Reply)
Hi,
Could someone please tell me what would happen if the following were entered into the command line:
rm -i /books/*.*
rm /books/*
Many thanks! (3 Replies)
The #1 Online Store for Louis Vuitton Replicas is: http://www.opichina.com.cn.
We offer Louis Vuitton Replicas and more! Whatever you call it: LV Bags, LV Replicas, Louis Vuitton Fake, Louis Vuitton Knockoffs, Louis Vuitton Bag, Louis Vuitton Purse, Louis Vuitton Wallet, Louis Vuitton Shoes,... (10 Replies)
I 'm using RH 7.2 Genome in the Network Configuration I change therer are two places one for static hostname for my machine and in DNS hostname I don't know what happen when restarting my PC when connecting using dialer I can't browse the Internet also I can't use sendmail .......Server timeout... (2 Replies)