在 linux 终端中它说文件存在
In linux terminal it says file exists
当我 运行 一个程序并且我想将这个程序的输出发送到一个文件中时。
我试过的
> tclsh hello.tcl > temp_out.txt
第一次将输出发送到 temp_out.txt 文件,但如果我再次 运行 然后它说
文件存在
> tclsh hello.tcl > temp_out.txt
> temp_out.txt : File exists
我希望当我 运行 这个程序时它应该删除文件的内容并再次将输出添加到 temp_out.txt 文件..
试试这样 运行,
tclsh hello.tcl >! temp_out.txt
它将覆盖现有的[temp_out.txt]文件。
当我 运行 一个程序并且我想将这个程序的输出发送到一个文件中时。 我试过的
> tclsh hello.tcl > temp_out.txt
第一次将输出发送到 temp_out.txt 文件,但如果我再次 运行 然后它说 文件存在
> tclsh hello.tcl > temp_out.txt
> temp_out.txt : File exists
我希望当我 运行 这个程序时它应该删除文件的内容并再次将输出添加到 temp_out.txt 文件..
试试这样 运行,
tclsh hello.tcl >! temp_out.txt
它将覆盖现有的[temp_out.txt]文件。