C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-06-2005, 03:43 PM   #1
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,629
Linux equivalent of con

What is the Linux equivalent of con?

For example, in DOS, if a program requires a file as input, you can use "con" as the filename, and it will read data from the keyboard.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, etc.

New project: nort
dwks is offline   Reply With Quote
Old 11-07-2005, 09:36 AM   #2
Sr. Software Engineer
 
filker0's Avatar
 
Join Date: Sep 2005
Location: West Virginia
Posts: 235
It all depends on what you want. "/dev/tty" should get you the user terminal, though this is not always the Linux console -- it may be an X-Term. If you're trying for the system console, I believe that "/dev/console" is what you need. You may not have access as a user to the system console, however.
filker0 is offline   Reply With Quote
Old 11-12-2005, 11:25 AM   #3
Me
 
-=SoKrA=-'s Avatar
 
Join Date: Oct 2002
Location: Europe
Posts: 448
Usually, when passing arguments to a program, you can usually specify - (a dash) as the filename. This has to be implemented by the program, though.

If you're writing a program, use stdin, but that's standard C.
__________________
SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
I say what I say, I mean what I mean.
IDE: emacs + make + gcc and proud of it.
-=SoKrA=- is offline   Reply With Quote
Old 11-12-2005, 11:58 AM   #4
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,629
Okay, thanks. I'll have to implement the - filename.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, etc.

New project: nort
dwks is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Equivalent to volume serial number in linux Elkvis Linux Programming 8 06-30-2009 08:46 PM
ReadProcessMemory/WriteProcessMemory Linux equivalent? MrLucky C++ Programming 7 07-27-2007 09:36 AM
Linux equivalent to Win32 ShellExecute BobS0327 Linux Programming 4 06-07-2006 04:35 AM
Linux equivalent to CreateDirectory Rak'kar Linux Programming 2 07-10-2004 12:04 PM
.bat equivalent for linux ichijoji Linux Programming 8 03-07-2004 08:06 AM


All times are GMT -6. The time now is 01:56 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22