Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a08a7c44
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a08a7c44
编写于
12月 29, 2022
作者:
Z
zhuhongtao66
提交者:
futurezhou
1月 14, 2023
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modified XTS for read and write interface
Signed-off-by:
N
zhuhongtao66
<
zhuhongtao12@huawei.com
>
上级
eb82e5a8
变更
3
展开全部
显示空白变更内容
内联
并排
Showing
3 changed file
with
1274 addition
and
158 deletion
+1274
-158
storage/storagefileiov9jstest/src/main/js/test/Common.js
storage/storagefileiov9jstest/src/main/js/test/Common.js
+10
-3
storage/storagefileiov9jstest/src/main/js/test/members/read.test.js
...oragefileiov9jstest/src/main/js/test/members/read.test.js
+642
-56
storage/storagefileiov9jstest/src/main/js/test/members/write.test.js
...ragefileiov9jstest/src/main/js/test/members/write.test.js
+622
-99
未找到文件。
storage/storagefileiov9jstest/src/main/js/test/Common.js
浏览文件 @
a08a7c44
...
...
@@ -15,6 +15,7 @@
import
fileio
from
'
@ohos.fileio
'
;
import
fileIO
from
'
@ohos.file.fs
'
;
import
util
from
'
@ohos.util
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
export
const
FILE_CONTENT
=
'
hello world
'
;
...
...
@@ -53,7 +54,7 @@ export function prepareEmptyFile(fpath) {
export
function
fileToReadOnly
(
fpath
)
{
try
{
let
file
=
file
io
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
CREATE
)
let
file
=
file
IO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
CREATE
)
fileio
.
fchmodSync
(
file
.
fd
,
0o444
)
fileio
.
fsyncSync
(
file
.
fd
)
fileio
.
closeSync
(
file
.
fd
)
...
...
@@ -67,7 +68,7 @@ export function fileToReadOnly(fpath) {
export
function
fileToWriteOnly
(
fpath
)
{
try
{
let
file
=
file
io
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
CREATE
|
fileIO
.
OpenMode
.
WRITE_ONLY
)
let
file
=
file
IO
.
openSync
(
fpath
,
fileIO
.
OpenMode
.
CREATE
|
fileIO
.
OpenMode
.
WRITE_ONLY
)
fileio
.
fchmodSync
(
file
.
fd
,
0o222
)
fileio
.
fsyncSync
(
file
.
fd
)
fileio
.
closeSync
(
file
.
fd
)
...
...
@@ -117,6 +118,10 @@ function isIntNum(val) {
return
typeof
val
===
'
number
'
&&
val
%
1
===
0
;
}
function
isBigInt
(
val
)
{
return
typeof
val
===
'
bigint
'
;
}
function
isString
(
str
)
{
return
(
typeof
str
==
'
string
'
)
&&
str
.
constructor
==
String
;
}
...
...
@@ -133,10 +138,12 @@ export {
fileio
,
fileIO
,
isIntNum
,
isBigInt
,
isString
,
isBoolean
,
isInclude
,
describe
,
it
,
expect
expect
,
util
};
\ No newline at end of file
storage/storagefileiov9jstest/src/main/js/test/members/read.test.js
浏览文件 @
a08a7c44
此差异已折叠。
点击以展开。
storage/storagefileiov9jstest/src/main/js/test/members/write.test.js
浏览文件 @
a08a7c44
此差异已折叠。
点击以展开。
鸿蒙社区
@harmonycommunity
mentioned in commit
dae79541
·
1月 17, 2023
mentioned in commit
dae79541
mentioned in commit dae795417c2d1b403037967ef99d514160c2dce9
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录