How to read terminal attributes using ioctl()


 
Thread Tools Search this Thread
Top Forums Programming How to read terminal attributes using ioctl()
# 1  
Old 05-17-2008
How to read terminal attributes using ioctl()

I want to get the terminal attributes such as ,
terminal width
terminal height
current cursor position

Can I use ioctl function.
Please help me how to use this function to get these details..

If possible please explain with a sample code.

I'm very new to UNIX progrmming....

Thanks and Regards,
Sree
# 2  
Old 05-17-2008
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Read and manage mail under Terminal

When opening Terminal window under Mac OS Lion, I have a message saying I've got mail . It seems to be somewhere close to ~/Library/Server/Mail/Data/spool/ but I ignore what command to be typed in order to read it and suppress it later once read. (1 Reply)
Discussion started by: shub22
1 Replies

2. UNIX for Dummies Questions & Answers

read from terminal/keyboard > /dev/tty

Hi, I need to provide more than one character to "> /dev/tty" through terminal/keyboard input, I have this: ok=false while do echo " Enter r1 to reformat " > /dev/tty read choice case $choice in ) echo " bla bla bla " ;; done However, in this way,... (3 Replies)
Discussion started by: Gery
3 Replies

3. UNIX for Dummies Questions & Answers

read a .bin through terminal and output a checksum?

Hi all, Ive been given a .bin file that I want to do a checksum on to make sure that it is consistant with what I know should be the checksum. I have tried using md5sum but it spits out a 128 bit line rather than a 32 bit line, which is what I want. Can someone help set me off in the right... (7 Replies)
Discussion started by: TeamUSA
7 Replies

4. UNIX for Advanced & Expert Users

ioctl : strace

Hi All, int ioctl(int d, int request, ...); Can somebody tell me how does ioctl decides the input parameter: "request". Sometimes, its SNDCTL_TMR_TIMEBASE or TCGETS or FIONREAD...etc. What is the pattern?? I am asking this coz my strace returns this: ... (1 Reply)
Discussion started by: angad.makkar
1 Replies

5. Programming

Using ioctl to read mice inputs

I was wondering if its possible to read mouse inputs using ioctl functions somehow ? If it is not too much of trouble can anyone write or even direct me to sample code of ioctl reading someother HID. (2 Replies)
Discussion started by: maverick_
2 Replies

6. Programming

read terminal command

hi how to read terminal command, just i want to read all command which write on terminal so please tell me any system call, api avilable in c for above purpose (6 Replies)
Discussion started by: munnu
6 Replies

7. UNIX for Dummies Questions & Answers

How to read lock terminal values in solaris

Hi all I am using sun solaris 5.8. I wanna know where the value stored if we lock/unlock the terminal and how i can read and use it to my script. I am helpless . So plzzzzzz... (0 Replies)
Discussion started by: pankajarora_12
0 Replies

8. Shell Programming and Scripting

read from terminal

If I do: cat file | write user I can cat a file to a users terminal. My question is, how can this user read the input and cat it into a file? I tried the reverse: read | file or read > file etc. But it didn't work. (1 Reply)
Discussion started by: rein
1 Replies

9. Programming

ioctl()

UNIX, gnu cc compiler, SUN Ultra 60 Hello, this is my first post, so please bear with me. I'm currently developing a test environment for a network subsystem that, when live, accesses databases and other network elements. However, my test environment will be run offline, so I need to fake... (4 Replies)
Discussion started by: j_t_kim
4 Replies

10. Shell Programming and Scripting

Terminal Hungup at the time of read

Hi, There are two scripts. The second script is called from the first one. These will create two processes on unix. In the second script, there is a read statement in the while loop. Under unexpected conditions, at the time of reading response from the user, if the terminal hungup happens,... (1 Reply)
Discussion started by: pkusumam
1 Replies
Login or Register to Ask a Question