例子: var file = new FileX('/sdcard/my.txt'); file.write('hello'); console.log('read ret:' + file.read());
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
fullPath | string | 必填 | 文件全路径,比如:/sdcard/test.txt。注意:支持打包文件,打包时把文件添加到apk,使用asset:来访问,比如:asset:test.txt |
参数名 | 类型 | 必填 | 说明 |
---|
参数名 | 类型 | 必填 | 说明 |
---|
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
charset | string | 选填 | 字符集,默认为utf-8 |
参数名 | 类型 | 必填 | 说明 |
---|
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
content | string | 必填 | 写到文件中的数据 |
charset | string | 选填 | 字符集,默认为utf-8 |
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
content | string | 必填 | 追加到文件中的数据 |
charset | string | 选填 | 字符集,默认为utf-8 |