Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
928f6b95
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
928f6b95
编写于
7月 14, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6733 修改fileio、securityLabel、storage-statistics、volumemanager文档
Merge pull request !6733 from raoxian/master
上级
84d79b77
99fabc7f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
87 addition
and
139 deletion
+87
-139
zh-cn/application-dev/reference/apis/js-apis-fileio.md
zh-cn/application-dev/reference/apis/js-apis-fileio.md
+53
-128
zh-cn/application-dev/reference/apis/js-apis-securityLabel.md
...n/application-dev/reference/apis/js-apis-securityLabel.md
+4
-1
zh-cn/application-dev/reference/apis/js-apis-storage-statistics.md
...lication-dev/reference/apis/js-apis-storage-statistics.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md
...n/application-dev/reference/apis/js-apis-volumemanager.md
+26
-6
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-fileio.md
浏览文件 @
928f6b95
...
...
@@ -16,6 +16,7 @@ import fileio from '@ohos.fileio';
## 使用说明
使用该功能模块对文件/目录进行操作前,需要先获取其应用沙箱路径,获取方式及其接口用法请参考:
```
js
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
let
context
=
featureAbility
.
getContext
();
...
...
@@ -353,58 +354,11 @@ closeSync(fd: number): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
fileio
.
closeSync
(
fd
);
```
## fileio.close<sup>7+</sup>
close(): Promise
<
void
>
关闭文件流,使用Promise异步回调。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
**返回值:**
| 类型 | 说明 |
| ------------------- | ---------------------------- |
| Promise
<
void
>
| Promise对象。无返回值。 |
**示例:**
```
js
fileio
.
close
().
then
(
function
(){
console
.
info
(
"
close file stream succeed
"
);
}).
catch
(
function
(
err
){
console
.
info
(
"
close file stream failed with error:
"
+
err
);
});
```
## fileio.close<sup>7+</sup>
close(callback: AsyncCallback
<
void
>
): void
关闭文件流,使用callback异步回调。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ------------- |
| callback | AsyncCallback
<
void
>
| 是 | 异步关闭文件流之后的回调。 |
**示例:**
```
js
fileio
.
close
(
function
(
err
){
// do something
});
```
## fileio.copyFile
copyFile(src:string | number, dest:string | number, mode?:number):Promise
<
void
>
...
...
@@ -430,6 +384,8 @@ copyFile(src:string | number, dest:string | number, mode?:number):Promise<voi
**示例:**
```
js
let
src
=
path
;
let
dest
=
src
+
'
tgt
'
;
fileio
.
copyFile
(
src
,
dest
).
then
(
function
(){
console
.
info
(
"
copyFile succeed
"
);
}).
catch
(
function
(
err
){
...
...
@@ -458,6 +414,8 @@ copyFile(src: string | number, dest: string | number, mode: number, callback: As
**示例:**
```
js
let
src
=
path
;
let
dest
=
src
+
'
tgt
'
;
fileio
.
copyFile
(
src
,
dest
,
function
(
err
)
{
// do something
});
...
...
@@ -483,6 +441,8 @@ copyFileSync(src: string | number, dest: string | number, mode?: number): void
**示例:**
```
js
let
src
=
path
;
let
dest
=
src
+
'
tgt
'
;
fileio
.
copyFileSync
(
src
,
dest
);
```
...
...
@@ -1059,7 +1019,7 @@ hash(path: string, algorithm: string): Promise<string>
```
js
fileio
.
hash
(
path
,
"
sha256
"
).
then
(
function
(
str
){
console
.
info
(
"
calculate file hash succeed:
"
+
str
);
}).
catch
(
function
(
err
or
){
}).
catch
(
function
(
err
){
console
.
info
(
"
calculate file hash failed with error:
"
+
err
);
});
```
...
...
@@ -1116,7 +1076,7 @@ chmod(path: string, mode: number):Promise<void>
**示例:**
```
js
fileio
.
chmod
(
path
,
mode
).
then
(
function
()
{
fileio
.
chmod
(
path
,
0o700
).
then
(
function
()
{
console
.
info
(
"
chmod succeed
"
);
}).
catch
(
function
(
err
){
console
.
info
(
"
chmod failed with error:
"
+
err
);
...
...
@@ -1143,7 +1103,7 @@ chmod(path: string, mode: number, callback: AsyncCallback<void>): void
**示例:**
```
js
fileio
.
chmod
(
path
,
mode
,
function
(
err
)
{
fileio
.
chmod
(
path
,
0o700
,
function
(
err
)
{
// do something
});
```
...
...
@@ -1167,7 +1127,7 @@ chmodSync(path: string, mode: number): void
**示例:**
```
js
fileio
.
chmodSync
(
path
,
mode
);
fileio
.
chmodSync
(
path
,
0o700
);
```
...
...
@@ -1194,6 +1154,7 @@ fstat(fd: number): Promise<Stat>
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
fileio
.
fstat
(
fd
).
then
(
function
(
stat
){
console
.
info
(
"
fstat succeed:
"
+
JSON
.
stringify
(
stat
));
}).
catch
(
function
(
err
){
...
...
@@ -1307,7 +1268,9 @@ ftruncate(fd: number, len: number, callback:AsyncCallback<void>): void
**示例:**
```
js
fileio
.
ftruncate
(
fd
,
len
,
function
(
err
){
let
fd
=
fileio
.
openSync
(
path
);
let
len
=
5
;
fileio
.
ftruncate
(
fd
,
5
,
function
(
err
){
// do something
});
```
...
...
@@ -1331,6 +1294,8 @@ ftruncateSync(fd: number, len?: number): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
len
=
5
;
fileio
.
ftruncateSync
(
fd
,
len
);
```
...
...
@@ -1359,6 +1324,7 @@ truncate(path: string, len?: number): Promise<void>
**示例:**
```
js
let
len
=
5
;
fileio
.
truncate
(
path
,
len
).
then
(
function
(){
console
.
info
(
"
truncate file succeed
"
);
}).
catch
(
function
(
err
){
...
...
@@ -1386,6 +1352,7 @@ truncate(path: string, len: number, callback:AsyncCallback<void>): void
**示例:**
```
js
let
len
=
5
;
fileio
.
truncate
(
path
,
len
,
function
(
err
){
// do something
});
...
...
@@ -1410,6 +1377,7 @@ truncateSync(path: string, len?: number): void
**示例:**
```
js
let
len
=
5
;
fileio
.
truncateSync
(
path
,
len
);
```
...
...
@@ -1467,13 +1435,13 @@ readText(filePath: string, options: {
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | ------------------------------------------------------------ |
| filePath | string | 是 | 待读取文件的应用沙箱路径。 |
| options | Object |
否
| 支持如下选项:
<br/>
-
position,number类型,表示期望读取文件的位置。可选,默认从当前位置开始读取。
<br/>
-
length,number类型,表示期望读取数据的长度。可选,默认缓冲区长度减去偏移长度。
<br/>
-
encoding,string类型,表示数据的编码方式,默认
'utf-8',仅支持
'utf-8'。 |
| options | Object |
是
| 支持如下选项:
<br/>
-
position,number类型,表示期望读取文件的位置。可选,默认从当前位置开始读取。
<br/>
-
length,number类型,表示期望读取数据的长度。可选,默认缓冲区长度减去偏移长度。
<br/>
-
encoding,string类型,表示数据的编码方式,默认
'utf-8',仅支持
'utf-8'。 |
| callback | AsyncCallback
<
string
>
| 是 | 回调函数,返回读取文件的内容。 |
**示例:**
```
js
fileio
.
readText
(
path
,
function
(
err
,
str
){
fileio
.
readText
(
path
,
{
position
:
1
,
encoding
:
'
UTF-8
'
},
function
(
err
,
str
){
// do something
});
```
...
...
@@ -1593,76 +1561,6 @@ lstatSync(path:string): Stat
```
## fileio.read<sup>7+</sup>
read(buffer: ArrayBuffer, options?: {
position?: number;
offset?: number;
length?: number;
}): Promise
<
ReadOut
>
从文件读取数据,使用Promise异步回调。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ----------- | ---- | ------------------------------------------------------------ |
| buffer | ArrayBuffer | 是 | 用于保存读取到的文件数据的缓冲区。 |
| options | Object | 否 | 支持如下选项:
<br/>
-
offset,number类型,表示将数据读取到缓冲区的位置,即相对于缓冲区首地址的偏移。可选,默认为0。
<br/>
-
length,number类型,表示期望读取数据的长度。可选,默认缓冲区长度减去偏移长度。
<br/>
约束:offset+length<=buffer.size。 |
**返回值:**
| 类型 | 说明 |
| ---------------------------------- | ------ |
| Promise
<
[ReadOut](#readout)
>
| Promise对象。返回读取的结果。 |
**示例:**
```
js
fileio
.
read
(
new
ArrayBuffer
(
4096
)).
then
(
function
(
readout
){
console
.
info
(
"
read file data succeed
"
);
console
.
log
(
String
.
fromCharCode
.
apply
(
null
,
new
Uint8Array
(
readOut
.
buffer
)));
}).
catch
(
function
(
err
){
console
.
info
(
"
read file data failed with error:
"
+
err
);
});
```
## fileio.read<sup>7+</sup>
read(buffer: ArrayBuffer, options: {
position?: number;
offset?: number;
length?: number;
}, callback: AsyncCallback
<
ReadOut
>
): void
从文件读取数据,使用callback异步回调。
**系统能力**
:SystemCapability.FileManagement.File.FileIO
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| buffer | ArrayBuffer | 是 | 用于保存读取到的文件数据的缓冲区。 |
| options | Object | 否 | 支持如下选项:
<br/>
-
offset,number类型,表示将数据读取到缓冲区的位置,即相对于缓冲区首地址的偏移。可选,默认为0。
<br/>
-
length,number类型,表示期望读取数据的长度。可选,默认缓冲区长度减去偏移长度。
<br/>
约束:offset+length<=buffer.size。 |
| callback | AsyncCallback
<
[ReadOut](#readout)
>
| 是 | 异步从文件读取数据之后的回调。 |
**示例:**
```
js
let
buf
=
new
ArrayBuffer
(
4096
);
fileio
.
read
(
buf
,
function
(
err
,
readOut
)
{
if
(
readOut
)
{
console
.
info
(
"
read file data succeed
"
);
console
.
log
(
String
.
fromCharCode
.
apply
(
null
,
new
Uint8Array
(
readOut
.
buffer
)));
}
});
```
## fileio.rename<sup>7+</sup>
rename(oldPath: string, newPath: string): Promise
<
void
>
...
...
@@ -1687,6 +1585,8 @@ rename(oldPath: string, newPath: string): Promise<void>
**示例:**
```
js
let
oldPath
=
path
;
let
newPath
=
oldPath
+
'
123
'
;
fileio
.
rename
(
oldPath
,
newPath
).
then
(
function
()
{
console
.
info
(
"
rename succeed
"
);
}).
catch
(
function
(
err
){
...
...
@@ -1714,6 +1614,8 @@ rename(oldPath: string, newPath: string, callback: AsyncCallback<void>): v
**示例:**
```
js
let
oldPath
=
path
;
let
newPath
=
oldPath
+
'
123
'
;
fileio
.
rename
(
oldPath
,
newPath
,
function
(
err
){
});
```
...
...
@@ -1737,6 +1639,8 @@ renameSync(oldPath: string, newPath: string): void
**示例:**
```
js
let
oldPath
=
path
;
let
newPath
=
oldPath
+
'
123
'
;
fileio
.
renameSync
(
oldPath
,
newPath
);
```
...
...
@@ -1764,6 +1668,7 @@ fsync(fd: number): Promise<void>
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
fileio
.
fsync
(
fd
).
then
(
function
(){
console
.
info
(
"
sync data succeed
"
);
}).
catch
(
function
(
err
){
...
...
@@ -1790,6 +1695,7 @@ fsync(fd: number, callback: AsyncCallback<void>): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
fileio
.
fsync
(
fd
,
function
(
err
){
// do something
});
...
...
@@ -1813,6 +1719,7 @@ fsyncSync(fd: number): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
fileio
.
fsyncSync
(
fd
);
```
...
...
@@ -1840,6 +1747,7 @@ fdatasync(fd: number): Promise<void>
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
fileio
.
fdatasync
(
fd
).
then
(
function
(
err
)
{
console
.
info
(
"
sync data succeed
"
);
}).
catch
(
function
(
err
){
...
...
@@ -1866,6 +1774,7 @@ fdatasync(fd: number, callback:AsyncCallback<void>): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
fileio
.
fdatasync
(
fd
,
function
(
err
)
{
// do something
});
...
...
@@ -1889,6 +1798,7 @@ fdatasyncSync(fd: number): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
stat
=
fileio
.
fdatasyncSync
(
fd
);
```
...
...
@@ -1917,6 +1827,8 @@ symlink(target: string, srcPath: string): Promise<void>
**示例:**
```
js
let
target
=
path
;
let
srcPath
=
target
+
'
aaa
'
;
fileio
.
symlink
(
target
,
srcPath
).
then
(
function
()
{
console
.
info
(
"
symlink succeed
"
);
}).
catch
(
function
(
err
){
...
...
@@ -1944,6 +1856,8 @@ symlink(target: string, srcPath: string, callback: AsyncCallback<void>): v
**示例:**
```
js
let
target
=
path
;
let
srcPath
=
target
+
'
aaa
'
;
fileio
.
symlink
(
target
,
srcPath
,
function
(
err
)
{
// do something
});
...
...
@@ -1968,6 +1882,8 @@ symlinkSync(target: string, srcPath: string): void
**示例:**
```
js
let
target
=
path
;
let
srcPath
=
target
+
'
aaa
'
;
fileio
.
symlinkSync
(
target
,
srcPath
);
```
...
...
@@ -2163,6 +2079,8 @@ fchmod(fd: number, mode: number): Promise<void>
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
mode
=
0o700
;
fileio
.
fchmod
(
fd
,
mode
).
then
(
function
()
{
console
.
info
(
"
chmod succeed
"
);
}).
catch
(
function
(
err
){
...
...
@@ -2190,6 +2108,8 @@ fchmod(fd: number, mode: number, callback: AsyncCallback<void>): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
mode
=
0o700
;
fileio
.
fchmod
(
fd
,
mode
,
function
(
err
)
{
// do something
});
...
...
@@ -2214,6 +2134,8 @@ fchmodSync(fd: number, mode: number): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
mode
=
0o700
;
fileio
.
fchmodSync
(
fd
,
mode
);
```
...
...
@@ -2416,6 +2338,7 @@ fchown(fd: number, uid: number, gid: number): Promise<void>
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
stat
=
fileio
.
statSync
(
path
);
fileio
.
fchown
(
fd
,
stat
.
uid
,
stat
.
gid
).
then
(
function
()
{
console
.
info
(
"
chown succeed
"
);
...
...
@@ -2445,6 +2368,7 @@ fchown(fd: number, uid: number, gid: number, callback: AsyncCallback<void>
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
stat
=
fileio
.
statSync
(
path
);
fileio
.
fchown
(
fd
,
stat
.
uid
,
stat
.
gid
,
function
(
err
){
// do something
...
...
@@ -2471,6 +2395,7 @@ fchownSync(fd: number, uid: number, gid: number): void
**示例:**
```
js
let
fd
=
fileio
.
openSync
(
path
);
let
stat
=
fileio
.
statSync
(
path
);
fileio
.
fchownSync
(
fd
,
stat
.
uid
,
stat
.
gid
);
```
...
...
@@ -3103,7 +3028,7 @@ read(buffer: ArrayBuffer, options?: {
```
js
let
ss
=
fileio
.
createStreamSync
(
path
,
"
r+
"
);
ss
.
read
(
new
ArrayBuffer
(
4096
),
{
offset
:
1
,
length
:
5
,
position
:
5
}).
then
(
function
(
read
o
ut
){
ss
.
read
(
new
ArrayBuffer
(
4096
),
{
offset
:
1
,
length
:
5
,
position
:
5
}).
then
(
function
(
read
O
ut
){
console
.
info
(
"
read data succeed
"
);
console
.
log
(
String
.
fromCharCode
.
apply
(
null
,
new
Uint8Array
(
readOut
.
buffer
)));
}).
catch
(
function
(
err
){
...
...
@@ -3180,7 +3105,7 @@ readSync(buffer: ArrayBuffer, options?: {
## Dir
管理目录,在调用Dir的方法前,需要先通过
[
opendir()
](
#fileioopendir
)
方法(同步或异步)来构建一个Dir实例。
管理目录,在调用Dir的方法前,需要先通过
opendir
方法(同步或异步)来构建一个Dir实例。
### read
...
...
@@ -3450,7 +3375,7 @@ isSocket(): boolean
**示例:**
```
js
let
dir
=
fileio
.
opendirSync
(
d
path
);
let
dir
=
fileio
.
opendirSync
(
path
);
let
isSocket
=
dir
.
readSync
().
isSocket
();
```
...
...
zh-cn/application-dev/reference/apis/js-apis-securityLabel.md
浏览文件 @
928f6b95
...
...
@@ -18,7 +18,10 @@ import securityLabel from '@ohos.securityLabel';
```
js
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
let
context
=
featureAbility
.
getContext
();
let
path
=
context
.
getFilesDir
();
let
path
=
''
;
context
.
getFilesDir
().
then
((
data
)
=>
{
path
=
data
;
})
```
## securityLabel.setSecurityLabel
...
...
zh-cn/application-dev/reference/apis/js-apis-storage-statistics.md
浏览文件 @
928f6b95
...
...
@@ -470,7 +470,7 @@ getUserStorageStats(userId? : number): Promise<StorageStats>
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------ | ---- | ---- |
| userId |
string
| 否 | 用户id
<br/>
确认当前用户:
<br/>
-
有值:表示指定用户。
<br/>
-
无值:表示当前用户。|
| userId |
number
| 否 | 用户id
<br/>
确认当前用户:
<br/>
-
有值:表示指定用户。
<br/>
-
无值:表示当前用户。|
**返回值:**
...
...
@@ -481,7 +481,7 @@ getUserStorageStats(userId? : number): Promise<StorageStats>
**示例:**
```
js
let
userId
=
""
;
let
userId
=
1
;
storageStatistics
.
getUserStorageStats
(
userId
).
then
(
function
(
StorageStats
){
console
.
info
(
"
getUserStorageStats successfully:
"
+
JSON
.
stringify
(
StorageStats
));
}).
catch
(
function
(
err
){
...
...
@@ -507,13 +507,13 @@ getUserStorageStats(userId: number, callback:AsyncCallback<StorageStats>):
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------ | ---- | -------------------------- |
| userId |
string
| 否 | 用户id
<br/>
确认当前用户:
<br/>
-
有值:表示指定用户。
<br/>
-
无值:表示当前用户。 |
| userId |
number
| 否 | 用户id
<br/>
确认当前用户:
<br/>
-
有值:表示指定用户。
<br/>
-
无值:表示当前用户。 |
| callback | callback:AsyncCallback
<
[StorageStats](#StorageStats)
>
| 是 | 返回各类别数据大小之后的回调 |
**示例:**
```
js
let
userId
=
""
;
let
userId
=
1
;
storageStatistics
.
getUserStorageStats
(
userId
,
function
(
error
,
StorageStats
){
// do something
console
.
info
(
"
getUserStorageStats successfully:
"
+
JSON
.
stringify
(
StorageStats
));
...
...
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md
浏览文件 @
928f6b95
...
...
@@ -204,7 +204,11 @@ getVolumeByUuid(uuid: string): Promise<Volume>
```
js
let
uuid
=
""
;
let
volume
=
await
volumemanager
.
getVolumeByUuid
(
uuid
);
volumemanager
.
getVolumeByUuid
(
uuid
).
then
(
function
(
volume
)
{
console
.
info
(
"
getVolumeByUuid successfully:
"
+
JSON
.
stringify
(
volume
));
}).
catch
(
function
(
error
){
console
.
info
(
"
getVolumeByUuid failed with error:
"
+
error
);
});
```
## volumemanager.getVolumeByUuid
...
...
@@ -259,7 +263,11 @@ getVolumeById(id: string): Promise<Volume>
```
js
let
id
=
""
;
let
volume
=
await
volumemanager
.
getVolumeById
(
id
);
volumemanager
.
getVolumeById
(
id
).
then
(
function
(
volume
)
{
console
.
info
(
"
getVolumeById successfully:
"
+
JSON
.
stringify
(
volume
));
}).
catch
(
function
(
error
){
console
.
info
(
"
getVolumeById failed with error:
"
+
error
);
});
```
## volumemanager.getVolumeById
...
...
@@ -316,7 +324,11 @@ setVolumeDescription(uuid: string, description: string): Promise<void>
```
js
let
uuid
=
""
;
let
description
=
""
;
let
bool
=
await
volumemanager
.
setVolumeDescription
(
uuid
,
description
);
volumemanager
.
setVolumeDescription
(
uuid
,
description
).
then
(
function
()
{
console
.
info
(
"
setVolumeDescription successfully
"
);
}).
catch
(
function
(
error
){
console
.
info
(
"
setVolumeDescription failed with error:
"
+
error
);
});
```
## volumemanager.setVolumeDescription
...
...
@@ -373,7 +385,11 @@ format(volId: string): Promise<void>
```
js
let
volId
=
""
;
let
bool
=
await
volumemanager
.
format
(
volId
);
volumemanager
.
format
(
volId
).
then
(
function
()
{
console
.
info
(
"
format successfully
"
);
}).
catch
(
function
(
error
){
console
.
info
(
"
format failed with error:
"
+
error
);
});
```
## volumemanager.format
...
...
@@ -430,7 +446,11 @@ partition(volId: string, fstype: string): Promise<void>
```
js
let
volId
=
""
;
let
fstype
=
""
;
let
bool
=
await
volumemanager
.
partition
(
volId
,
fstype
);
volumemanager
.
partition
(
volId
,
fstype
).
then
(
function
()
{
console
.
info
(
"
partition successfully
"
);
}).
catch
(
function
(
error
){
console
.
info
(
"
partition failed with error:
"
+
error
);
});
```
## volumemanager.partition
...
...
@@ -456,7 +476,7 @@ partition(volId: string, fstype : string, callback: AsyncCallback<void>):
```
js
let
volId
=
""
;
let
fstype
=
""
;
volumemanager
.
format
(
volId
,
fstype
,
(
error
,
bool
)
=>
{
volumemanager
.
partition
(
volId
,
fstype
,
(
error
,
bool
)
=>
{
// do something
});
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录