English 中文(简体)
UNIX是/dev/tty? [闭门]
原标题:What is /dev/tty in UNIX? [closed]
  • 时间:2012-05-03 16:14:09
  •  标签:
  • unix

要求我们提议或找到一种工具、图书馆或偏袒场外资源的问题,由于这些问题往往吸引有意见的答复和垃圾邮件,因而成为Stack Overflow的场所。 相反, 问题以及迄今为止为解决这一问题所做的工作。

Closed 10 years ago.

Both stdin and stdout file descriptors point to it. How does it work? Can some one point to a good resource for understanding UNIX terminals and system calls that interact with it.

最佳回答

dev/tty is a file system object that represents the current console. Copying files into this "directory" from the command line prints out the content of these files to your console:

cp myfile.txt /dev/tty

等于

cat myfile.txt

这些目的就是让你使用熟悉的APICS号文档,与Cole进行互动。 这是一种将青 API素与抗体阳性反应器相统一的方法。 您可使用<条码>fopen,fprintf等,以与普通档案相同的方式与专栏进行互动。

This example writes "Hello, world " to the terminal:

#include <stdio.h>

int main (int argc, const char * argv[]) {
    FILE *f = fopen("/dev/tty", "w");
    fprintf(f, "Hello, world!
");
    return 0;
}
问题回答

暂无回答




相关问题
Generate assembler code from C file in linux

I would like to know how to generate assembler code from a C program using Unix. I tried the gcc: gcc -c file.c I also used firstly cpp and then try as but I m getting errors. I m trying to build an ...

Function to create the array by reading the file

I am creating scripts which will store the contents of pipe delimited file. Each column is stored in a separate array. I then read the information from the arrays and process it. There are 20 pipe ...

Compare characters at the end of the string C++

This program supposed to find command line arguments entered on Unix which ends with “.exe”. For some reason it doesn t work. Here is the code: int main( int argc, char* argv[] ) { for ( int ...

Batch Job Dependencies Using Open Source/Free Software

I run a large data warehouse plant where we have a lot of nightly jobs running concerruently however many have dependencies on a extract or data load process before they start. Currently we use an ...

Writing application for both Unix and Windows

I ll write a program for Interactive UNIX (http://en.wikipedia.org/wiki/INTERACTIVE_UNIX). But in a year it will be ported to Windows. I ll write it in ANSI C and/or SH-script. When it runs on Windows ...

Development Environment in Windows [closed]

What are your recommendations for setting up a development environment in Windows, especially when not using an IDE. I am attempting to familiarize myself with Windows, and I feel a bit lost. What ...

热门标签