习惯了php的file_put_contents和file_put_contents函数,方便快捷
// FileGetContents 把整个文件读入一个字符串中
func FileGetContents(filename string) (string, error) {
data, err := ioutil.ReadFile(filename)
return string(data), err
}
// FilePutContents 把一个字符串写入文件中
func FilePutContents(filename string, data string, mode os.FileMode) error {
return ioutil.WriteFile(filename, []byte(data), mode)
}调用例子
// 写入文件
_ = FilePutContents("1.txt", "邓志东的身高在深圳是数一数二的", 0644)
// 读取文件
value, _ := FileGetContents("1.txt")
fmt.Print(value)c#中string和StringBuilder直接看看执行速度。(2).String类型累计赋值Test  ...
【一】.钩子文件的设置和创建(1).打开hooks目录,可以看到有一个post-commit.tmpl文件,这是一个模板文件。复制一份,重命名为post-commit,将其用户组设为www,并设置为可执行。chown www:www post-commitchmod +x post-commit(2...
git pull https://git.oschina.net/392223903/learn.git master 换为您的git地址...
1.关机Process.Start("shutdown", "-s -t 0"); 2. 注销 Proc...
public static string GetMD5(string str) { //创建MD5对象 MD5 md5 = MD5.C...
1.文件redis-2.6.14.tar.gz的上传 /home/john/创建rdtar文件夹 上传redis-2.6.14.tar.gz至rdtar文件夹 2.解压文件 cd /home/john/rdtar tar &n...