Here is a list of The Different Modes of Opening a File:
Modes
Description
r |
Read-only mode. The file pointer is placed at the beginning of the file. This is the default mode. |
r+ |
Read-write mode. The file pointer will be at the beginning of the file. |
w |
Write-only mode. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing. |
w+ |
Read-write mode. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for
reading and writing. |
a |
Write-only mode. The file pointer is at the end of
the file if the file exists. That is, the file is in the append mode.
If the file does not exist, it creates a new file for writing. |
a+ |
Read and write mode. The file pointer is at the end
of the file if the file exists. The file opens in the append mode. If
the file does not exist, it creates a new file for reading and writing. |
分享到:
相关推荐
ruby文件操作
ruby文件操作大全,主要是DIR,FILE和文件夹类的相关操作,比较实用
ruby打包文件ruby打包文件ruby打包文件ruby打包文件ruby打包文件ruby打包文件ruby打包文件ruby打包文件ruby打包文件
ruby实现文件对比资料收集,看完之后写一个文件对比的脚本或者输出报告没有问题,可以看看,
ruby 目录操作详细介绍,增删查改,移动文件等等操作
主要介绍了Ruby常用文件操作方法,本文讲解了新建文件、读取文件、删除、重命名文件、目录操作等常用文件操作方法,需要的朋友可以参考下
Ruby的Ini文件读写,含实例,操作方法 对于学习Ruby的人会有一定的参考价值。
ruby对excel的操作 详细描述ruby对excel的操作
在ruby中用fastercsv导出csv文件。 给出了主要文件,如有疑问请查google。
刚学习ruby,交出自己的学习成果,请大侠们不要见笑,希望对初学者能有所帮助,我们共同提高!
自己动手写的几个实用的ruby文件上传功能,有controller、view,database,可以根据自己的需要添加或者减少代码和视图
ruby的库帮助文件,对于Ruby开发者应该必备的工具
NULL 博文链接:https://huigou.iteye.com/blog/1154745
ruby资源文件,ruby rdoc.gem文件,离线ruby文件包
ruby脚本,用来分析case覆盖率,文件名,文件个数等等
Source Insight CLF插件,使SourceInsight支持Ruby语言
Ruby 读写 txt文件 自用 网络资源...
Ruby学习资源,包含16个ruby文件,含代码,一步一步学习ruby,以及对应的html官方文档资源。 Ruby学习资源,包含16个ruby文件,含代码,一步一步学习ruby,以及对应的html官方文档资源。 Ruby学习资源,包含16个ruby...