Windows 7命令提示符是否有与stdbuf等效的文件? [英] Is there an stdbuf equivalent for Windows 7 command prompt?
问题描述
因此gnu具有stdbuf,它允许您修改命令的I/O流的缓冲.我需要命令提示符具有相同的功能,但似乎找不到任何相关信息.
So gnu has stdbuf which allows you to modify buffering of a command's I/O stream. I need the same functionality for command prompt but I can't seem to find anything about it.
我只是试图将程序的stdout和stderr都输出到日志文件中,而不进行缓冲(或者,只是为了使它们同步并以与控制台中显示的顺序相同的方式).
I'm simply trying to output both stdout and stderr of a program, to a logfile, without buffering (or rather, just so that they are in sync and in the same order they would be displayed as in the console).
我只是错过了一些明显的命令或语法,还是在Windows中运气不好?
Did I just miss some obvious command or syntax, or am I just out of luck in windows?
推荐答案
Take a look at this. I don't have Windows to test on, but my guess is that you would need something like this:
.\foo.bat > .\bar.log 2>&1
This will default to buffered IO, which is not exactly what you want, but unbuffered output does not seem to be possible.
这篇关于Windows 7命令提示符是否有与stdbuf等效的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!