如何追加到使用计划的文件? [英] How to append to a file using Scheme?
本文介绍了如何追加到使用计划的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用TinyScheme(其实脚本中福GIMP),并不能找到打开一个文件和一行文本追加到它的好方法。
I am using TinyScheme (actually Script-Fu in GIMP), and cannot find a good way to open a file and append a line of text to it.
我想记录一些信息,以用于调试的文件,成绩单上似乎并没有实现......
I am trying to log some info to the file for debugging, and transcript-on doesn't seem to be implemented...
现在我通过阅读整个文件(一个字符的时间!),串联了成一个字符串,串联我的文字到了年底,然后重新写这一切了该文件刮一起。
Right now I am scraping along by reading the entire file (one character at a time!), concatenating that into a string, concatenating my text to the end of that, then writing it all out to the file again.
必须有一个更好的办法!
There must be a better way!
推荐答案
这将是类似
(open-file "myfile" (file-options append))
您想查找文件选项
功能。
这里的诡诈版本:
(open-file "myfilename.dat" "a")
这篇关于如何追加到使用计划的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文