创建一个的最佳方式是什么emptyRuby 中的文件?
类似于 Unix 命令的东西,touch https://en.wikipedia.org/wiki/Touch_%28Unix%29:
touch file.txt
FileUtils.touch http://apidock.com/ruby/FileUtils/touch/class looks like what it does, and mirrors* the touch
command:
require 'fileutils'
FileUtils.touch('file.txt')
* Unlike touch(1) http://www.manpagez.com/man/1/touch/ you can't update mtime or atime alone. It's also missing a few other nice options.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)