Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7ea4ba60
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看板
未验证
提交
7ea4ba60
编写于
1月 14, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 14, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7050 Modified XTS for read and write interface
Merge pull request !7050 from futurezhou/read_write
上级
a03d0ffe
a08a7c44
变更
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
浏览文件 @
7ea4ba60
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
import
fileio
from
'
@ohos.fileio
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
fileIO
from
'
@ohos.file.fs
'
;
import
fileIO
from
'
@ohos.file.fs
'
;
import
util
from
'
@ohos.util
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
export
const
FILE_CONTENT
=
'
hello world
'
;
export
const
FILE_CONTENT
=
'
hello world
'
;
...
@@ -53,7 +54,7 @@ export function prepareEmptyFile(fpath) {
...
@@ -53,7 +54,7 @@ export function prepareEmptyFile(fpath) {
export
function
fileToReadOnly
(
fpath
)
{
export
function
fileToReadOnly
(
fpath
)
{
try
{
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
.
fchmodSync
(
file
.
fd
,
0o444
)
fileio
.
fsyncSync
(
file
.
fd
)
fileio
.
fsyncSync
(
file
.
fd
)
fileio
.
closeSync
(
file
.
fd
)
fileio
.
closeSync
(
file
.
fd
)
...
@@ -67,7 +68,7 @@ export function fileToReadOnly(fpath) {
...
@@ -67,7 +68,7 @@ export function fileToReadOnly(fpath) {
export
function
fileToWriteOnly
(
fpath
)
{
export
function
fileToWriteOnly
(
fpath
)
{
try
{
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
.
fchmodSync
(
file
.
fd
,
0o222
)
fileio
.
fsyncSync
(
file
.
fd
)
fileio
.
fsyncSync
(
file
.
fd
)
fileio
.
closeSync
(
file
.
fd
)
fileio
.
closeSync
(
file
.
fd
)
...
@@ -117,6 +118,10 @@ function isIntNum(val) {
...
@@ -117,6 +118,10 @@ function isIntNum(val) {
return
typeof
val
===
'
number
'
&&
val
%
1
===
0
;
return
typeof
val
===
'
number
'
&&
val
%
1
===
0
;
}
}
function
isBigInt
(
val
)
{
return
typeof
val
===
'
bigint
'
;
}
function
isString
(
str
)
{
function
isString
(
str
)
{
return
(
typeof
str
==
'
string
'
)
&&
str
.
constructor
==
String
;
return
(
typeof
str
==
'
string
'
)
&&
str
.
constructor
==
String
;
}
}
...
@@ -133,10 +138,12 @@ export {
...
@@ -133,10 +138,12 @@ export {
fileio
,
fileio
,
fileIO
,
fileIO
,
isIntNum
,
isIntNum
,
isBigInt
,
isString
,
isString
,
isBoolean
,
isBoolean
,
isInclude
,
isInclude
,
describe
,
describe
,
it
,
it
,
expect
expect
,
util
};
};
\ No newline at end of file
storage/storagefileiov9jstest/src/main/js/test/members/read.test.js
浏览文件 @
7ea4ba60
此差异已折叠。
点击以展开。
storage/storagefileiov9jstest/src/main/js/test/members/write.test.js
浏览文件 @
7ea4ba60
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录