Programming :: How To Skip Getchar In C
Oct 1, 2010
I would like to read an input from keyboard using getchar. However, if no input (No Carriage return/new line none whatsoever) is given after say, 5 seconds, I would like to skip the getchar and move on. How do I do this in C. I'm using GNU compiler set.
View 6 Replies
ADVERTISEMENT
Jul 10, 2010
How do I make getchar() skip a leading space? The situation I am looking is this: I print a prompt that ends in a space printf("Input: ");and then when I use getchar() to read the text that was typed after the prompt, it appears to process the trailing space as a leading space that belongs to the input.
how can the space be skipped, preferably without inserting code that explicitly checks whether I'm reading the first character or not. I have already found out that I can skip such a space using scanf scanf (" %c", &ch); where the leading space in the format string eliminates leading spaces from the input string. That is the sort of thing I have in mind.
View 7 Replies
View Related
Aug 27, 2010
I need to list a directory recursively but I want to skip subdirs that were already mounted. There are 2 cases:
a) a filesystem was mounted twice, like in this example:
- "/dev/sda2" was mounted on "/mnt/mnt_point1"
- "/dev/sda2" was mounted on "/mnt/mnt_point2"
I want to list "/mnt" but descend only in "/mnt/mnt_point1"
b) part of the file hierarchy was remounted somewhere else, with "mount --bind":
- "mount --bind /home/user/tmp/test /home/user/tmp/mounted_test"
I want to list "/home/user/tmp" but descend only in "test" "statfs" and "statvfs" don't offer any information to discern if a dir was mounted twice. One solution would be to read "/etc/mtab" (as "find" command does it) and perform some checks, but I think that this is pretty expensive (one has to read /etc/mtab every time one encounters a dir; if this file is read only when program starts, a mount could occur in between reads, so that the program will be inaccurate). Another solution would be to filter kernel events (via libudev or Netlink) and do this reading of /etc/mtab only when a MOUNT event was issued.
View 1 Replies
View Related
Jun 6, 2010
GNU/Linux kernel 2.6, Slackware 12.0
MPlayer 1.0rc2-4.1.2
GNU Bash 3.1.17
I've got a set of MP3 files on dir .../foo/ and I want mplayer to play them sequencely but skipping some of them. If I run 'mplayer *' this will do but ofcourse won't skip any files. I think a shell script could be written to do that. It would be something like this (using some pseudocode):
#!/bin/bash
#After an example from Intro_Linux by M. Garret.
LIST=$(ls *.mp3)
[code]....
View 3 Replies
View Related
Mar 15, 2011
I have a bash script which is composed of different functions.I want to able to select which functions to be executed when i run the script, for that i thought about using a flag in the function. but i dont know how to skip the function whose flag is set to zero.
Code:
myfunc1(){
local flag=1
commands
{
[code]....
View 2 Replies
View Related
Mar 5, 2011
I issued chown '-hR <user>:<group> *' on a directory. chown also change dot and dot-dot in cwd and all subirectories. How do I go about recursively changing ownership without changing dot and dot-dot?
View 2 Replies
View Related
Jul 6, 2011
Strange problem from a couple of months, Audio files skip every now and then. Sounds like buffering issue. MP3, Wav etc. all skip on VLC, Qamp etc, once in a minute or two, its quite random. i thought there was CPU spikes or something by some program i installed. I checked the system monitor and found no unusual spikes in the CPU... so i am thinking this must be the audio buffers. Can i set the buffers for the for the driver or something? my machine is: Dell Inspiron Mini netbook Ubutu lucid 10.04, 2bg RAM, 260GB HDD
View 1 Replies
View Related
Apr 3, 2010
My question is: How to skip the installation of a package when using yum update from the command line? i.e., How would one update a system from command line and skip/not update kernel?
View 4 Replies
View Related
Oct 8, 2010
There is a problem with dependency resolution for the recent updates; i can't update my system even with the skip-broken, there is something to nautilus and phyton-devel and phyton, pls, take note of these.
View 3 Replies
View Related
Sep 24, 2010
When i install openSUSE 11.3, reboot the system, and then yast stay in automatic configuration. It take a long time to download some packages, and it seems that it has no response already. How would i skip this step?
View 2 Replies
View Related
Aug 3, 2010
I just upgraded two 11.2 installations. One I easily managed from the dvd the other I had to install anew as the cd didn't offer the possibility of upgrading. While I appreciated the many improvements in desktop stability I found I am non very satisfied of the installer.
It became minimal and just does what IT wants and not what I want anymore. I miss the possibility of choosing desktops, programmes and settings during installation. Most of all I miss the possibility of choosing the bootloader and its location. I have a multi boot multi disk machine and I prefer to modify entries by hand so i never install the loader but add the new entry in the grub but this was not possible and it made just a mess erasing completely all other entries....
Booting has always been a great problem for one of my machines and I'm not going to upgrade it if thisi is the result. Is there a way of going back to the old options (no loader?) Why are the new installer always "easier" but less flexible for a user who's not geek but not even a newbie? Why does it have always to be more "Windows like"
View 5 Replies
View Related
Jun 6, 2010
I am using a live USB of 10.04 Netbook edition. Every time I boot up the Installation wizard opens. Is there a way to skip this and go directly to the gnome desktop? Figure I just need to edit some boot scripts but I dont know which one.
View 1 Replies
View Related
Oct 14, 2010
Is it possible to have Nautilus stop prompting me to confirm file overwrites when copying files? This would be very practical (with the obvious risk, but still). I have not been able to find this somewhere...
View 1 Replies
View Related
May 6, 2011
how to skip the grub menu in Natty? The way I used to do it in /etc/default/grub no longer works.
View 3 Replies
View Related
May 21, 2011
I'm running maverick netbook remix on an asus1015pe eeepc. I recently switched from the unity interface to "ubuntu netbook 2d" - the one they say resembles the 10.04 netbook interface. I really like it - fast, crisp, and intuitive - but there's one thing I'd like to change, if possible. Right after login, there's a full-screen translucent menu that covers the 1st workspace. If I wait a few seconds, I can make it go away by clicking the "desktop" button in the bottom left, but is there any way to make it so it doesn't appear at all? so that after login it goes right to a clean desktop.
View 2 Replies
View Related
Mar 7, 2011
I'm using Ubuntu Lucid Lynx and every time I search for updates it ask for authentication. I'd like to search and apply updates without confirmation. Is it possible in some manner?
View 4 Replies
View Related
Apr 26, 2010
Google is full of users which cannot get a DHCP address So no matter what search term I use, I only see solutions which do not apply to this problem. I am running Debian Squeeze on a netbook eeePC 1001P I have a wireless interface and a wired interface defined in /etc/network/interfaces:
Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
[code]....
Both interfaces WORK! When I have plugged in a cable, eth0 acquires and gets an IP, when I am in reach of the WiFi, wlan0 gets an IP address. Now when I want to use only wireless, and I have no LAN connected, this is what happens at boot:
Code:
ADDRCONF(NETDEV_UP): eth0: link is not ready
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
[code]....
This is fine, however it takes forever (I think 60 seconds) before DHCP decides to time out. That is awkward. This is my wife's computer and I cannot tell her to intervene manually when she is either in Wifi range or on the LAN. Why is dhclient called when it is detected that eth0 is not ready? How can I disable acquiring a DHCP address on an interface which is not ready? when a link is not ready, acquiring a DHCP address is skipped. How can I configure that? I have looked thru the ifup scripts, but nothing. Where do I see what is happening when the interface is auto eth0?
View 3 Replies
View Related
Mar 7, 2011
I'm using Ubuntu Lucid Lynx and every time I search for updates it ask for authentication. I'd like to search and apply updates without confirmation. Is it possible in some manner?
View 5 Replies
View Related
May 10, 2009
Are there any general recommendations on skipping creation of swap partition on servers? If I am sure that server will be ok with it's RAM is there any benefit in skipping swap partition creation or making it the least size possible other than saving disk space?
View 3 Replies
View Related
Sep 13, 2010
[code]...
You could try using --skip-broken to work around the problem. You could try running: rpm -Va --nofiles --nodigest. how can I fix it?
View 5 Replies
View Related
Jan 12, 2011
Whatever i try to play a .avi or play a Flash movie the movie does that... by the way the sound does the same thing. Followed the Multi-media and Restricted Format Installation Guide Used the MMCHECK - Check Your Multimedia in 10 Steps - Script File, as proposed by RedDwarf and Googled and found this: [URL] but it does not help me because I already run opensuse 11.3 with a 2.6.34-12 kernel My Laptop with the Problem:
Asus X51RL
Review Asus X51R Notebook - Notebookcheck.net Reviews
View 1 Replies
View Related
Apr 2, 2011
When playing a song, I am unable to manipulate the seek bar and skip to&fro, it's seems absolutely except for the fact the cursors (if that's the right word for it) glows, and it says "Jump to XXX" but it does nothing. This pretty much happens on any and every song, however if I play another track come back it may or may not work. Sometimes it works fine (usually not), but it'll freeze again after the track changes.
View 7 Replies
View Related
Apr 9, 2010
when watching a movie in browser (ff/chrome) or using mplayer to replace flash on ..... for instance, i cannot skip around the video i'm watching...
- is there a way to be able to skip forward/backwards with mplayer?
- is there a way to replace mplayer with another program that will allow me to skip?
View 4 Replies
View Related
May 22, 2010
I would like to have some entries in GRUB2 so that I can directly boot Windows XP and Seven without having to load the Windows bootloader (so I would like to avoid one step, now is:load GRUB2 --> then Windows loader --> then Windows boots. I would like it to be: load GRUB2 --> then Windows boots). s this possible?This is what I have now in my grub.cfg
Code:
cat << EOF
menuentry "Windows Operating Systems (XP & Seven)" {
[code]....
View 5 Replies
View Related
Oct 30, 2010
I have installed Ubuntu 10.10 x64 bit edition. On booting Ubuntu wouldn't mount my partitions, so I installed pysdm to auto mount them during booting. But since then I often get during boot: Press S to skip mount or M for manual recovery. What should I do?
View 1 Replies
View Related
Feb 17, 2011
Im using the following system setup: When I boot my business computer, I can choose between 3 setups, 2 Windows XP, 1 DOS. I installed Ubuntu with 1 Windows XP system which looks something like this:
System 1 (XP)
System 2 (XP) --> after selection, Im able to choose between the XP system and Ubuntu on a new screen
System 3 (DOS)
Now interesting for me is obviously System 2. After I select System 2, I can choose between XP and Ubuntu. After I select Ubuntu, I come to another screen, where I can choose again between 4 Ubuntu entries with different kernel versions (including their recovery modes) AND both XP systems (yes, again). I installed Grub Customizer. I removed all the XP entries and all but 1 Ubuntu entry from this screen. I also set the timeout until booting Ubuntu on this screen to 1 second to start as quick as possible and Ubuntu boots fine.
My question now is, is there a way to skip the screen with former kernel and XP selection and boot Ubuntu directly after already choosing (between XP and Ubuntu) on the first screen? I know, 1 second "waiting" is not too bad but skipping the screen completly would be superb.
View 3 Replies
View Related
Mar 7, 2011
I'm using Ubuntu Lucid Lynx and every time I search for updates it ask for authentication. I'd like to search and apply updates without confirmation. Is it possible in some manner?
View 1 Replies
View Related
Sep 4, 2009
I am trying to create an RPM package. However when the RPM package installs, it need to skip some files that might have been created by the user after the last installation and use of the program. Is there a way to build RPM package that just skips the user created content in the installation dir.
For example:
lets say my RPM package creates the following dir and creates files required by my application, say .app files.
/ppm/config/
However the user may also create a few .xml files in the same dir. How will I package my program that will not delete the .xml files from the above dir and will just create the application files (.app files).
View 2 Replies
View Related
Mar 16, 2011
I have created a customized RHEL 5.4 DVD and placed a Kickstart file in it.It is running fine except I have to manually choose "Local CDROM" in the installation process. (see attached pic)Any idea how to skip this.
View 3 Replies
View Related
Apr 13, 2010
We have one squid proxy server running on CentOS 5.3 64 bit with Squid 2.6. it works well for me.
but my problem/question is :
Is it possible to skip proxy for all Internet addresses? and only allow proxy if clients are accessing external addresses?
right now users have to explicitly say in the browsers .. BYPASS PROXY SERVER for local addresses after check the use proxy server
and address has to be mentioned. most users are non technical so they don't use this option or put wrong setting in bypass proxy option
View 2 Replies
View Related