【发布时间】:2020-05-02 07:55:00
【问题描述】:
在Chapel中,我们可以使用open() + iomode.cw打开一个文件进行写入,例如,
var fout = open( "foo.dat", iomode.cw ); // create a file for writing
var cout = fout.writer(); // make a channel
cout.writeln( 1.23 );
cout.close();
fout.close();
或通过openwriter()创建频道
var cout = openwriter( "foo.dat" );
cout.writef( "n = %10i, x = %15.7r\n", 100, 1.23 );
cout.close();
但似乎没有对应于“附加”模式的选项(在IO 页面中)。目前是否没有提供,如果有,是否有任何惯用的方式来打开文件和附加数据?
【问题讨论】: