Programming :: Timeout For Standard Input Using Tcsetattr Not Working?

Jan 5, 2010

The code is attached..My intention is that getchar which usually blocks,should come out after 5 seconds(VTIME).But this is not happening..can anyone tell me the mistake that I make..?

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>

[code]...

View 3 Replies


ADVERTISEMENT

General :: Ruby Program Which Use Standard Input?

May 15, 2010

I am using Red Hat Enterprise Version 5. There is a ruby program which use standard input as its input (e.g. the Ruby program process input from standard input). I think standard input should be keyboard, correct?

So, I think other kinds of input (non-standard input) should not work (i.e. the ruby program should not be able to read input from such non-standard input), but actually I have tried using pipe works, I am so confused because I think pipe should be some other kinds of input -- other than standard input, why it could work? i.e. put text "123" in abc.txt with pipe, could achieve the same result as using keyboard as input to type "123" for the ruby program.

cat abc.txt | ~/test/rubysrc/foo.rb

View 4 Replies View Related

Red Hat / Fedora :: Read From Standard Input In 'growisofs' Command?

Jul 12, 2010

I need to create backup of internal drive and write it on DVD. I want to do this in single command...like below: ntfsclone -f --save-image --overwrite - /dev/sda1 | growisofs -Z /dev/sr1=/dev/stdin

in above command, i tried to to create backup of first partition of internal drive and need to write this backup on DVD. But above command has some probolem due to which it could not write backup on DVD....and how to read from standard input in 'growisofs' command?

View 2 Replies View Related

Programming :: Working With User Input In Bash

Jun 2, 2009

I've been using python/bash to help myself automate things for a long time, however I am curious. One reason I use python more is because I don't quite know how to work with user input in Bash, such as getting it to ask for input and wait, and then placing that user input into a command.

Here's an example of a script I use from time to time for converting OGG video files into AVI.

How could I write this same script in Bash? Keep in mind I am mostly self taught, so I am by no means an expert programmer.

Code:

View 3 Replies View Related

Software :: Cant Convert Audio Files Using Flac With Standard Input?

Jun 28, 2011

I cant convert audio files using flac with standard input. I tried the commands such as:

Code:
mpg321 -b 10000 -s -r 44100 -w - file.mp3 | flac - -o file.flac
or:
Code:
ogg123 -d wav -f - file.ogg | flac - -o file.flac

[Code]....

All such conversions doesnt produce any *.flac file. It seems flac doesnt accept minus sign for the standard input although flac manual allows to use it.

So my question is how I can use the standard input in order to decode audio data with flac?

View 10 Replies View Related

Debian Hardware :: Standard Xserver-xorg-input-synaptics Is Undergoing Some Weird Changes At The Moment?

Apr 22, 2011

Just did an upgrade in Wheezy and found my synaptics touchpad borked. Easy enough fix, though.aptitude install xserver-xorg-input-synaptics-devRebooted (probably could have just modprobed) and all is wellSo, I guess the standard xserver-xorg-input-synaptics is undergoing some weird changes at the moment.

View 1 Replies View Related

Ubuntu :: GRUB Timeout Not Working ?

Nov 8, 2010

I am running Ubuntu 10.10. Grub timeout is not working and I have to press enter every time I switch on the computer after the Grub menu loads. Here is my /boot/grub/grub.cfg file

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub[code]......

View 3 Replies View Related

General :: Grub Timeout Is Not Working?

Apr 19, 2009

here is my grub.con

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file

[code]...

View 15 Replies View Related

Ubuntu :: Set The Default Os To Boot As Windows 7 With A Timeout Of 1 Second - Reset The Timeout To 3 Seconds?

Aug 4, 2011

I set the default os to boot as windows 7 with a timeout of 1 second. I thought that this would be enough time to switch os ubuntu when i need to, but I am unable to. How can i reset the timeout to 3 seconds? I also cannot view the ubuntu partition within windows because of ubuntu's file system.

View 9 Replies View Related

Ubuntu :: Grub Timeout Not Working On New Installation?

Oct 28, 2010

Just installed kubuntu 10.4 on a netbook (dual booting with WinXP) but by default grub just boots directly into kubuntu. When editing /etc/default/grub I have tried setting the timeout to 10, 100 and now its at -1 (which should be sit there forever)I then run update-grub which generates the new config reboot and the same thing happens, it immediately boots to kubuntu. I see the menu appear for a split second, but no matter how fast i try, i cannot see to hit any button fast enough to kill the timeout so i can switch to XP.

View 1 Replies View Related

Server :: RHEL 4 Grub Timeout Not Working?

Mar 29, 2010

I have an RHEL 4 server now running 2.6.9-89.0.18. After installing the kernel and rebooting to make this the current kernel, the grub menu to choose the kernel failed to offer a countdown and did not choose the kernel as it should have. I had to manually select the kernel.I inspected the grub.conf file and could not find any clue as to why it didn't work. The timeout directive is there, and the syntax matches other systems we have with the same kernel and OS.Can anyone provide any insight as to what else (other than a typo on the conf file) would cause this?The only difference between the way the kernel update (and the subsequent changes to the grub conf file) took place was a manual install of the RPM on the affected system, versus pulling it down from RHN using up2date.

View 11 Replies View Related

Programming :: Location Of - Gnu - C++ Standard Library

Jul 21, 2010

Where is the location of the header files for the c++ standard library?

I assume that they were installed by gnu g++, please correct me if i'm wrong.

I'm running ubuntu 10.04 with g++ 4.4.

I looked in /usr/lib/gcc/i486-linux-gnu/4.4/include, but this directory contains only the following:

Code:

Which doesnt seem to include the really basic things like iostream, for example.

Where can I take a look at the header files for these standard c++ libraries?

View 2 Replies View Related

Ubuntu Installation :: Grub Timeout Not Working After Upgrade From 10.04 To 10.10?

Oct 17, 2010

Yesterday I upgraded from 10.04 to 10.10 (x86_64). The upgrade itself succeeded, but now after booting I have to press enter in the grub OS list. grub.cfg looks like this:

Code:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.

[code]...

Why do I have to press enter to have grub boot the default entry? How can I get grub to start the default entry automatically, without showing the menu? BTW: entries in the list are default:

Code:

Ubuntu, with Linux 2.6.35-22-generic
Ubuntu, with Linux 2.6.35-22-generic (recovery mode)
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)

View 9 Replies View Related

Programming :: SSH Timeout - Stays Infinitely In The Background

Nov 24, 2008

I have a program that calls a program on a remote host via SSH in the background. In the command similar to the following:

But the problem is, this program stays infinitely in the background. Is there any method of implementation so that I can kill it? like after 10 seconds of trying?

I am trying to refrain from using TCPKeepAlive or sshd_config stuffs configurations. I was thinking of a fork() implementation where the parent sleeps for 10 seconds and then, if the child still haven responds to it, kill it.

View 4 Replies View Related

Programming :: Programmatically Getting Standard File Dialog

Jul 14, 2010

Is it possible to do the following in C/C++ in Linux:Without direct linking (my program should NOT depend on Qt or GTK), display a GTK or Qt based file dialog.The behaviour should be something like this when my program runs, when you want to open a file:The program scans whether you have Qt installed. If so, it somehow manages to link itself to Qt (e.g. dynamically loading the .so file) and display its file dialog and get the path from it. If Qt wasn't found, it tries the same with GTK. If that also wasn't found, it displays a less powerful replacement dialog instead (better than nothing).

Or is there any other simple way in Linux to get a standard file dialog somehow (similar to when compiling for Windows you can very easily get its standard file dialog, no matter what version of Windows, in your code, even if your program doesn't use any other Windows GUI at all).

View 4 Replies View Related

Programming :: Reverse A String Without Using Standard Library?

Sep 22, 2010

I am making a program to reverse a string

Code:
#include<stdio.h>
int main ()
{
int i,j;

[Code].....

View 5 Replies View Related

Programming :: Awk Syntax For Calculating Average And Standard Deviation

Apr 20, 2011

I have a data in a column.

Code:

I want to calculate average and standard deviation. As first step I want to calculate average for the data than calculate (del=data - avg) for all the data.

I suppose get

Code:

For this I use AWK and the code goes like this

Code:

But I get different answers.

Code:

Why the answers are so different? since this is wrong I can not continue calculating the standard deviation.

View 6 Replies View Related

Programming :: Direct Standard Output From Find Command?

Mar 26, 2010

I'm trying to pull out sections from a bunch of files. For one file, I use:

Code:
sed '/string1/,/string2/ !d' <filename.ext >newfilename.ext
to pull out everything between two strings in the original file and put them in a new file.

[code]....

View 3 Replies View Related

Programming :: Related To Pthreads And Timers In POSIX Standard

Feb 17, 2010

I have created two threads:
Thread 1 and thread 2

In the main thread, i have put up a timer which generates a signal periodically when it expires, which reults in execution going to signal catcher function.when this function is invoked, under certain condition it goes to thread 1 and under another condition it goes to thread 2. The problem lies here that when it goes to thread2,i have a loop to process but it doesnt come out of the loop and hence from thread2, even though timer has expired.

View 2 Replies View Related

Programming :: Standard For Naming Convention Of Commandline Options

Feb 22, 2011

Is there any document or specification like the Linux Standard Base for the naming convention of commandline options?

View 3 Replies View Related

Programming :: Underscores In Standard Functions, An Example Section From Cat.c Is Included

Sep 4, 2010

From cat.c in GNU coreutils:

Code:
void
usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.

[Code]...

I don't remember ever seeing this in any examples I've ever seen, so I'm sure I've never seen an explanation of this.

View 1 Replies View Related

Slackware :: Get Standard PS/2 Wheel Mouse Working On The Console Command Line

Aug 13, 2010

I am trying to get my standard PS/2 Wheel mouse working on the Console command line, and seem to be having major problems getting it to work.

For the record, I am NOT talking about X, Xterm's or any Graphical Interface, my mouse wheel works fine in these environments.

I am purely concerned with getting the mouse wheel to work on the Console.

After many hours of reading forum posts about getting the wheel to work on the Console, this is what I have tried to date:

1. I have downloaded and installed every version of gpm I could find in the hope that one would utilise the wheel. (No Success).

2. I compiled and installed the latest version of gpm stable (1.20.6) to see if the wheel would work with it. (No Success).

3. I have tried setting up gpm-1.20.6 as a repeater to X, using every string I could find (msc, ms3, pnp .. etc), as well as every /dev entry in xorg.conf /dev/mouse, /dev/input/mice/, dev/gpmdata/, /dev/psaux ... etc). (No Success).

4. Created directories and configured a gpm.conf to both /etc/ and /etc/conf.d/ in the hope that gpm was looking for them there (read that in one forum or another). (No Success).

5. I then tried to find mouse wheel patches for gpm, and then downloaded the relevant version source gpm.***.tar.gz to go with these patches. Nearly every single one of the patches failed to apply (using patch -p1 >), except for one version I tried that did apply ... but then failed to make (stating that the source had a different signedness or some such thing) ??? (No Success).

6. I looked into IMwheel, but that seemed to be a purely X program that was a lazy way of writing ZAxisMapping in xorg.conf. (No Success).

So now I am stumped ... Does anyone know if if is possible to get:

a). A Wheel Mouse Patch for a recent version of gpm (1.20.6) that will actually apply, and then make?

b). A prepackaged recent version of gpm-1.20.6.tgz that has been patched to enable the wheel that I can use?

c). Any other information that may enable the mouse wheel to start working on the console.

View 6 Replies View Related

Programming :: Shell Programming - Delete User Input

Jan 21, 2011

I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.

Do i have to use sed command?

View 4 Replies View Related

Programming :: Perl About System Command / Fails If The Standard Shell Is Dash And Not Bash?

Jun 30, 2011

I am trying to fix a perl script, and I really suck at perl. But I think this problem will be easy for people who know it.

The problem is, I have an old setup script someone wrote many years ago. It fails if the standard shell is dash and not bash. The only way I've gotten it to work is to point /bin/sh to bash. I looked thru the script and it uses "system" many places, and I think that's the problem.

I searched for it and found this link:url

My plan is to include this function:

Code:
sub system_bash {
my @args = ( "bash", "-c", shift );
system(@args);
}
Then I could simply change all calls to system into system_bash and it should work?

The parameter to the system calls is usually some variable. What if the parameter is a list already? Do I need to test for it somehow, and if it's a list, prepend "bash" and "-c" to the list? How do I do that?

In the script there are lots of places like this:

my $error = system($cmd);
if ($error) {
die/warn "some error message";
}

Shouldn't there be a return in the system_bash function?

View 8 Replies View Related

Programming :: Input And Output On C++ Programming ?

Jan 28, 2010

As i am new to C++ i couldn't figure out how to input a file and make some change on the file and produce a output file. like this problem i have is.

"Program that processes an input file and produces an output file. The input file will contain lines of data, each containing two floating point numbers. The lines of the output file should contain the two numbers read and their average (with a '$' sign and 2 places after the decimal point)."

View 2 Replies View Related

Debian :: Input Sound Not Working?

Jul 9, 2010

So I have this cable going from a cassette players "phones" jack to my computers input jack but there is no sound coming from my speakers though it did with Windows XP.

View 2 Replies View Related

Fedora Hardware :: DVI Input Not Working

Feb 14, 2011

I upgraded from FC12 to FC14. I have a Samsung P2250 monitor which has both analog and DVI input. I have a Nvidia GE Force 8500 GT video card that also has analog and DVI ports. With FC12 I was using the DVI with no problem. After converting to FC14, the DVI does not work. If I use the analog ports, all is fine. I tried connecting both cables to see the results.

System - Preferences - Monitor shows 2 monitors. I assume that it is pickup both cables and thinks there are two monitors. I can turn either one off or on. If I turn the analog one off, the screen goes black until the 'Do you like this ' times out. It then comes back and I can work again. If I turn the digital one off, all works fine. If I disconnect the analog cable and boot the system, the POST messages show up, the GRUB menu shows up, but the screen goes black when FC14 loads.

View 1 Replies View Related

Programming :: Get Input Without The Terminal?

Apr 1, 2010

I've done a little program, it's the snake game. I use an X window to show the snake and all that but the input is taken from the terminal. That means that what I have to do to play the game is open it with the terminal and then the game opens but then I have to go to the terminal again to move the snake. if I open the game from the GUI I can't do anything because it doesn't take my directions. What do I have to do in order to get the program to have a connection with my keyboard? I use getchar() to get the input, maybe there is something else?

View 9 Replies View Related

Programming :: Get Input From Entry Using Gtk?

May 2, 2011

I'm trying to make a program to simulate a parabolic movement, so i've added 2 entries, one for the initial velocity and other for the angle, anyway you probably don't care about that xD what i want is to take the number entered in the entry and put it in a variable to do the math, and then show everything in a dialog or something. how do i do that?

View 3 Replies View Related

Programming :: Find Command With Standard Error Output And Mail Error File

Nov 11, 2010

We make everyday a DB Mysql backup on Linux redhat Enterprise. We are using a bash shell script (and putting it in the crontab) to execute it automatically everyday. We added a line to this script telling, once the backup has completed, to find old backup files (stored on hard disk after each backup) older than x days to remove them. We use the find command (search for file type) with the mtime option and in combination with rm command. Everything runs ok but we also want to add some new code to the same line: If find command cannot find anything or fails, for example if it cannot delete file or fails, send the error message (standard error output) to an error file (like error000001 and increasing) and mail the errorxxxx file to an email address for example to admin@companyname.com. What would be the code for this issue to add it to our find command in the same bash shell script??

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved