racket 文件读取与写入使用示例代码
代码语言:racket
所属分类:文件
代码描述:racket 文件读取与写入使用示例代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
#lang racket ;;文件新建 (define out-port (open-output-file "/tmp/tmp.txt")) (displayln "Hello World" out-port) (close-output-port out-port) ;; 文件追加 to "/tmp/tmp.txt" (define out-port2 (open-output-file "/tmp/tmp.txt" #:exists 'append)) (displayln "Hola mundo" out-port2) (close-output-port out-port2) ;;读取文件 ;; Read from the file again (define in-port (open-input-file &quo.........完整代码请登录后点击上方下载按钮下载查看
网友评论0