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

D
duangavin123 已提交
3

W
wenjun 已提交
4 5 6 7 8 9 10 11
## Command Function<a name="section366714216619"></a>

This command is used to write data to a specified proc file system. The proc file system supports the input of string parameters. Each file needs to implement its own method.

## Syntax<a name="section8833164614615"></a>

writeproc <_data_\>  \>\>  /proc/<_filename_\>

D
duangavin123 已提交
12
## Parameters<a name="section12809111019453"></a>
W
wenjun 已提交
13

D
duangavin123 已提交
14
**Table  1**  Parameter description
W
wenjun 已提交
15 16 17 18 19 20 21 22 23 24 25 26

<a name="table438mcpsimp"></a>
<table><thead align="left"><tr id="row444mcpsimp"><th class="cellrowborder" valign="top" width="21.000000000000004%" id="mcps1.2.4.1.1"><p id="p446mcpsimp"><a name="p446mcpsimp"></a><a name="p446mcpsimp"></a><strong id="b16354000851164"><a name="b16354000851164"></a><a name="b16354000851164"></a>Parameter</strong></p>
</th>
<th class="cellrowborder" valign="top" width="52.970000000000006%" id="mcps1.2.4.1.2"><p id="p448mcpsimp"><a name="p448mcpsimp"></a><a name="p448mcpsimp"></a><strong id="b2720614204911"><a name="b2720614204911"></a><a name="b2720614204911"></a>Description</strong></p>
</th>
<th class="cellrowborder" valign="top" width="26.030000000000005%" id="mcps1.2.4.1.3"><p id="p450mcpsimp"><a name="p450mcpsimp"></a><a name="p450mcpsimp"></a><strong id="b3067324051164"><a name="b3067324051164"></a><a name="b3067324051164"></a>Value Range</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="row451mcpsimp"><td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.4.1.1 "><p id="p2500105121818"><a name="p2500105121818"></a><a name="p2500105121818"></a>data</p>
</td>
D
duangavin123 已提交
27
<td class="cellrowborder" valign="top" width="52.970000000000006%" headers="mcps1.2.4.1.2 "><p id="p1149945111817"><a name="p1149945111817"></a><a name="p1149945111817"></a>Specifies the string to be entered, which ends with a space. If you need to enter a space, use <strong id="b11296145424918"><a name="b11296145424918"></a><a name="b11296145424918"></a>""</strong> to enclose the space.</p>
W
wenjun 已提交
28 29 30 31 32 33
</td>
<td class="cellrowborder" valign="top" width="26.030000000000005%" headers="mcps1.2.4.1.3 "><p id="p749810571812"><a name="p749810571812"></a><a name="p749810571812"></a>N/A</p>
</td>
</tr>
<tr id="row155978258237"><td class="cellrowborder" valign="top" width="21.000000000000004%" headers="mcps1.2.4.1.1 "><p id="p195983258238"><a name="p195983258238"></a><a name="p195983258238"></a>filename</p>
</td>
D
duangavin123 已提交
34
<td class="cellrowborder" valign="top" width="52.970000000000006%" headers="mcps1.2.4.1.2 "><p id="p25985252238"><a name="p25985252238"></a><a name="p25985252238"></a>Specifies the proc file to which <strong id="b1319518261507"><a name="b1319518261507"></a><a name="b1319518261507"></a>data</strong> is to be passed.</p>
W
wenjun 已提交
35 36 37 38 39 40 41 42 43
</td>
<td class="cellrowborder" valign="top" width="26.030000000000005%" headers="mcps1.2.4.1.3 "><p id="p10598425112312"><a name="p10598425112312"></a><a name="p10598425112312"></a>N/A</p>
</td>
</tr>
</tbody>
</table>

## Usage<a name="section15935131220717"></a>

D
duangavin123 已提交
44
The proc file implements its own  **write**  command. Calling the  **writeproc**  command will pass the input parameters to the  **write**  command.
W
wenjun 已提交
45

D
duangavin123 已提交
46
>![](../public_sys-resources/icon-note.gif) **NOTE:** 
D
duangavin123 已提交
47
>The procfs file system does not support multi-thread access.
W
wenjun 已提交
48 49 50

## Example<a name="section79281818476"></a>

D
duangavin123 已提交
51
Run  **writeproc test \>\> /proc/uptime**.
W
wenjun 已提交
52 53 54 55 56 57 58 59 60

## Output<a name="section12742311179"></a>

OHOS \# writeproc test \>\> /proc/uptime

\[INFO\]write buf is: test

test \>\> /proc/uptime

D
duangavin123 已提交
61
>![](../public_sys-resources/icon-note.gif) **NOTE:** 
W
wenjun 已提交
62 63
>The uptime proc file temporarily implements the  **write**  command. The  **INFO**  log is generated by the implemented  **test**  command.