将数据追加到文件末尾 (pfile.appends)

声明

操作成败 = pfile.appends(文件路径, 待追加内容)

参数及返回值

  • 文件路径
    • 文本型,文件绝对路径
  • 待追加内容
    • 字符串型,需要追加写入的数据
  • 操作成败
    • 布尔型,操作成功返回 true,操作失败返回 false

说明

pfile模块操作手机设备文件,如果你要操作ATP服务器的文件,请使用file模块。

示例

local success = pfile.appends("/sdcard/1.txt", "利国家生死矣")
if success then
    print("写入成功")
else
    print("写入失败")
end
powered by GitbookFile Modify: 2021-03-27 23:14:19

results matching ""

    No results matching ""