kernel-small-debug-shell-file-write.md 1.3 KB
Newer Older
A
Annie_wang 已提交
1 2
# writeproc

D
duangavin123 已提交
3

A
Annie_wang 已提交
4
## Command Function
W
wenjun 已提交
5

A
Annie_wang 已提交
6
This command is used to write data to the specified proc file system. The proc file system supports data of strings. The method for writing data needs to be implemented.
W
wenjun 已提交
7 8


A
Annie_wang 已提交
9
## Syntax
W
wenjun 已提交
10

A
Annie_wang 已提交
11
writeproc <*data*>  >>  /proc/<*filename*>
W
wenjun 已提交
12 13


A
Annie_wang 已提交
14
## Parameters
W
wenjun 已提交
15

A
Annie_wang 已提交
16
**Table 1** Parameter description
W
wenjun 已提交
17

A
Annie_wang 已提交
18 19 20 21
| Parameter    | Description                                                  |
| -------- | ---------------------------------------------------------- |
| data     | Specifies the string to write, which ends with a space. If you need to write a space, use **""** to enclose the space. |
| filename | Specifies the proc file to which **data** is to write.                               |
W
wenjun 已提交
22 23


A
Annie_wang 已提交
24
## Usage Guidelines
W
wenjun 已提交
25

A
Annie_wang 已提交
26
The proc file system implements its own **write()** function. Calling the **writeproc** command will pass input parameters to the **write()** function.
W
wenjun 已提交
27

A
Annie_wang 已提交
28 29
> **NOTE**<br>
> The procfs file system does not support multi-thread access.
W
wenjun 已提交
30

A
Annie_wang 已提交
31
## Note
W
wenjun 已提交
32

A
Annie_wang 已提交
33
Currently, the shell does not support this command.
W
wenjun 已提交
34

A
Annie_wang 已提交
35
## Example
W
wenjun 已提交
36

A
Annie_wang 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
Run **writeproc test >> /proc/uptime**.


## Output

```
OHOS \# writeproc test &gt;&gt; /proc/uptime

[INFO]write buf is: test

test &gt;&gt; /proc/uptime
```

> **NOTE**<br>
> The **uptime** proc file temporarily implements the **write()** function. The **INFO** log is generated by the **test()** function.
W
wenjun 已提交
52