user-interface - GUI程序需要标准流吗?

标签 user-interface stream unix

我读到了standard streams 。我的理解是没有 GUI 的老式程序也需要某种用户界面。因此操作系统为它们每个人提供了一个控制台窗口,并且控制台窗口的out/input/err流被映射到程序的标准输入/输出/错误流。因此这些程序被称为控制台应用程序。并且程序员无法修改此映射。

我想知道,如果我上面的理解是正确的,GUI程序也有这些标准流吗?我认为没有必要,因为 GUI 本身就是一个很好的用户界面。

最佳答案

我引用了您链接到的文章的底部:

Graphical user interfaces (GUIs) rarely make use of the standard streams.

Some GUI programs, primarily on Unix, still write debug information to standard error.

Others may take files to operate from standard in, for example many Unix media players do so.

因此,从上面的引用中,您可以看到,是的,尽管它们很少被使用。

"And this mappings couldn't be modified by the programmer."

这是不正确的——当然在 UNIX 上可能是这样——但在 Windows 上则不确定。例如,您可以关闭标准输出流并将其重定向到文件流,以将输出写入文件。

关于user-interface - GUI程序需要标准流吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2340280/

相关文章:

Android Activity.runOnUiThread 不是静态的,那么我该如何使用它呢?

vb.net - 是否可以将控件锚定到另一个控件?

unix - 如何在 screen session 中控制 screen session ?

xml - 编写 : How to use XMLStarlet to extract values in pom. xml 文件的脚本

c - 如何安装 GTK+ 及其所有依赖项?

c - 将像素绘制到屏幕,跨平台

java - System.out 声明为 static final 并用 null 初始化?

python - 使用 yield 而不是 return 创建函数以连续从 http 流生成帧

C# 将 MemoryStream 转换为 FileStream

c - unix 套接字 - 无法连接到服务器(连接超时)